/*
Theme Name: DrivingExams Canada
Theme URI: https://drivingexams.ca
Author: DrivingExams.ca
Author URI: https://drivingexams.ca
Description: Free Canadian driving practice tests for all provinces — G1, ICBC, Alberta Class 7, SGI, SAAQ, MPI and more. Pass your driving test on the first try.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: drivingexams
Tags: driving-test, canada, practice-test, education
*/

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:       #D32F2F;
  --red-dark:  #B71C1C;
  --red-light: #FFEBEE;
  --white:     #FFFFFF;
  --off-white: #F8F9FA;
  --gray-100:  #F1F3F4;
  --gray-300:  #DEE2E6;
  --gray-600:  #6C757D;
  --gray-900:  #212529;
  --text:      #1A1A2E;
  --shadow:    0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius:    10px;
  --radius-lg: 18px;
  --font:      'Inter', 'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =============================================
   HEADER / NAV
   ============================================= */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1160px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-logo .logo-icon {
  background: var(--red);
  color: var(--white);
  width: 42px; height: 42px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  font-weight: 900;
}

.site-logo .logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.site-logo .logo-text span { color: var(--red); }

.site-logo .logo-sub {
  font-size: 0.7rem;
  color: var(--gray-600);
  font-weight: 500;
  letter-spacing: 0.5px;
  display: block;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  align-items: center;
}

.main-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 7px 13px;
  border-radius: 6px;
  transition: all .2s;
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
  background: var(--red-light);
  color: var(--red);
  text-decoration: none;
}

.nav-cta a {
  background: var(--red) !important;
  color: var(--white) !important;
  border-radius: 6px;
  padding: 8px 16px !important;
}

.nav-cta a:hover { background: var(--red-dark) !important; }

.hamburger {
  display: none;
  background: none; border: none;
  font-size: 1.6rem;
  cursor: pointer; color: var(--text);
}

/* =============================================
   HERO
   ============================================= */
.hero {
  background: linear-gradient(135deg, #1A1A2E 0%, #D32F2F 100%);
  color: var(--white);
  padding: 80px 20px 70px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 18px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.hero h1 .highlight { color: #FFD700; }

.hero .subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: .9;
  max-width: 620px;
  margin: 0 auto 30px;
}

.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 35px;
}

.badge {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  backdrop-filter: blur(6px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--white);
  color: var(--red);
  box-shadow: 0 4px 18px rgba(0,0,0,.2);
}

.btn-primary:hover { background: #f0f0f0; transform: translateY(-2px); text-decoration: none; color: var(--red-dark); }

.btn-red {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 4px 18px rgba(211,47,47,.4);
}

.btn-red:hover { background: var(--red-dark); transform: translateY(-2px); text-decoration: none; color: var(--white); }

/* =============================================
   PROVINCE GRID
   ============================================= */
.provinces-section {
  padding: 70px 0;
  background: var(--off-white);
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.section-title p {
  color: var(--gray-600);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto;
}

.section-title .divider {
  width: 60px; height: 4px;
  background: var(--red);
  border-radius: 2px;
  margin: 14px auto 0;
}

.provinces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.province-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 20px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: all .25s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.province-card:hover {
  border-color: var(--red);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  text-decoration: none;
  color: var(--text);
}

.province-card .flag {
  font-size: 2.6rem;
  margin-bottom: 10px;
  display: block;
}

.province-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.province-card .exam-name {
  font-size: .78rem;
  color: var(--gray-600);
  font-weight: 500;
  margin-bottom: 12px;
}

.province-card .q-count {
  background: var(--red-light);
  color: var(--red);
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-block;
}

/* =============================================
   FEATURES / WHY US
   ============================================= */
.features-section {
  padding: 70px 0;
  background: var(--white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
}

.feature-card {
  background: var(--off-white);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  border-left: 4px solid var(--red);
}

.feature-card .icon {
  font-size: 2rem;
  margin-bottom: 14px;
  display: block;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--gray-600);
  font-size: .92rem;
  line-height: 1.6;
}

/* =============================================
   QUIZ ENGINE
   ============================================= */
.quiz-wrap {
  padding: 60px 0;
  background: var(--white);
}

.quiz-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 780px;
  margin: 0 auto;
  border: 1px solid var(--gray-300);
}

.quiz-header {
  background: linear-gradient(135deg, #1A1A2E, var(--red));
  padding: 24px 30px;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-header h3 { font-size: 1.2rem; font-weight: 700; }

.quiz-progress-bar {
  background: rgba(255,255,255,.3);
  height: 6px;
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.quiz-progress-fill {
  background: #FFD700;
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}

.quiz-body { padding: 34px 30px; }

.quiz-question-num {
  font-size: .8rem;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.quiz-question-text {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.5;
}

.quiz-options { display: flex; flex-direction: column; gap: 10px; }

.quiz-option {
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  font-size: .97rem;
  font-weight: 500;
  transition: all .2s;
  background: var(--white);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-option:hover { border-color: var(--red); background: var(--red-light); }
.quiz-option.selected { border-color: var(--red); background: var(--red-light); }
.quiz-option.correct { border-color: #2E7D32; background: #E8F5E9; color: #1B5E20; }
.quiz-option.incorrect { border-color: #C62828; background: #FFEBEE; color: #B71C1C; }

.quiz-option .opt-label {
  background: var(--gray-100);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
}

.quiz-explanation {
  margin-top: 18px;
  padding: 14px 18px;
  background: #E3F2FD;
  border-left: 4px solid #1565C0;
  border-radius: var(--radius);
  font-size: .9rem;
  line-height: 1.6;
  display: none;
}

.quiz-footer {
  padding: 20px 30px;
  border-top: 1px solid var(--gray-300);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--off-white);
}

.quiz-score {
  font-weight: 700;
  color: var(--text);
  font-size: .95rem;
}

.quiz-result {
  text-align: center;
  padding: 50px 30px;
  display: none;
}

.quiz-result .result-icon { font-size: 4rem; margin-bottom: 16px; }
.quiz-result h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.quiz-result p { color: var(--gray-600); margin-bottom: 24px; }
.quiz-result .score-big { font-size: 3rem; font-weight: 900; color: var(--red); }

/* =============================================
   TESTIMONIALS
   ============================================= */
.testimonials-section { padding: 70px 0; background: var(--off-white); }

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.stars { color: #FFB300; font-size: 1.1rem; margin-bottom: 12px; }

.testimonial-card p { font-style: italic; color: var(--gray-600); line-height: 1.7; margin-bottom: 16px; }

.testimonial-author { display: flex; align-items: center; gap: 12px; }

.author-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.author-info strong { display: block; font-size: .93rem; }
.author-info span { color: var(--gray-600); font-size: .82rem; }

/* =============================================
   FAQ
   ============================================= */
.faq-section { padding: 70px 0; background: var(--white); }

.faq-list { max-width: 760px; margin: 0 auto; }

.faq-item {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  padding: 18px 22px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  transition: background .2s;
}

.faq-question:hover { background: var(--red-light); }
.faq-question.open { background: var(--red-light); color: var(--red); }

.faq-arrow { font-size: 1.2rem; transition: transform .3s; }
.faq-question.open .faq-arrow { transform: rotate(180deg); }

.faq-answer {
  padding: 0 22px;
  max-height: 0;
  overflow: hidden;
  transition: all .3s ease;
  font-size: .95rem;
  color: var(--gray-600);
  line-height: 1.7;
}

.faq-answer.open {
  padding: 0 22px 18px;
  max-height: 400px;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: #1A1A2E;
  color: rgba(255,255,255,.85);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
  display: block;
}

.footer-brand .logo-text span { color: var(--red); }

.footer-brand p {
  font-size: .88rem;
  line-height: 1.7;
  color: rgba(255,255,255,.65);
  margin-bottom: 18px;
}

.footer-social { display: flex; gap: 10px; }

.social-btn {
  background: rgba(255,255,255,.1);
  color: var(--white);
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  text-decoration: none;
  transition: background .2s;
}

.social-btn:hover { background: var(--red); color: var(--white); text-decoration: none; }

.footer-col h4 {
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(255,255,255,.1);
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 9px; }

.footer-col a {
  color: rgba(255,255,255,.65);
  font-size: .88rem;
  transition: color .2s;
}

.footer-col a:hover { color: var(--white); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: rgba(255,255,255,.5);
}

/* =============================================
   PAGE HERO (inner pages)
   ============================================= */
.page-hero {
  background: linear-gradient(135deg, #1A1A2E, var(--red));
  color: var(--white);
  padding: 55px 20px 50px;
  text-align: center;
}

.page-hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 900; margin-bottom: 12px; }
.page-hero p { opacity: .88; font-size: 1.05rem; max-width: 580px; margin: 0 auto; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .main-nav { display: none; }
  .main-nav.open { display: block; position: absolute; top: 68px; left: 0; right: 0; background: var(--white); padding: 16px; box-shadow: var(--shadow-lg); border-top: 2px solid var(--red); }
  .main-nav.open ul { flex-direction: column; }
  .hamburger { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .quiz-body, .quiz-footer { padding: 22px 16px; }
  .quiz-header { padding: 18px 16px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
