:root {
      --bg: #f8f9fa;
      --card: #ffffff;
      --accent: #007bff;
      --muted: #6c757d;
      --text: #212529;
      --border: #dee2e6;
      --glass: rgba(0, 0, 0, 0.02);
    }
    html, body {
      height: 100%;
      margin: 0;
      font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
      color: var(--text);
      background-color: var(--bg);
      display: flex;
      flex-direction: column;
      min-height: 100vh;
    }
    .app {
      max-width: 1200px;
      margin: auto;
      padding: 20px;
      box-sizing: border-box;
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: center;
    }
    .panel {
      background: var(--card);
      border-radius: 12px;
      padding: 18px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
      border: 1px solid var(--border);
      max-width: 500px; /* Added for consistent width */
      margin: 0 auto;    /* Horizontal centering only — prevents vertical centering in flex layout */
      align-self: flex-start; /* Added to force top alignment */
      margin-top: 0; /* Ensure panels do not add additional top margin */
    }
    h1 {
      font-size: 18px;
      margin: 4px 0 12px;
      color: var(--text);
    }
    label {
      display: block;
      font-size: 13px;
      color: var(--muted);
      margin: 10px 0 6px;
    }
    select, input[type=number], button, textarea {
      width: 100%;
      padding: 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--glass);
      color: var(--text);
      font-size: 14px;
    }
    /* Apply flex-grow to select and input within flex containers */
    .controls div[style*="display:flex"] > select,
    .controls div[style*="display:flex"] > input[type="number"] {
      flex-grow: 1;
    }
    /* Apply flex-grow to select and input within flex containers */
    .controls div[style*="display:flex"] > select,
    .controls div[style*="display:flex"] > input[type="number"] {
      flex-grow: 1;
    }
    .small {
      font-size: 12px;
      color: var(--muted);
    }
    .controls .row {
      display: flex;
      gap: 8px;
    }
    .controls .row > * {
      flex: 1;
    }
    .actions {
      display: flex;
      gap: 8px;
      margin-top: 12px;
    }
    button.primary {
      background: var(--accent);
      border: none;
      color: #fff;
      padding: 11px 12px;
      border-radius: 10px;
      cursor: pointer;
      transition: background-color 0.2s;
    }
    button.primary:hover {
        background: #0056b3;
    }
    button.ghost {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--accent);
      cursor: pointer;
      transition: background-color 0.2s, color 0.2s;
    }
    button.ghost:hover {
        background: var(--accent);
        color: #fff;
    }
    .main {
      padding: 18px;
    }
    .question-card {
      background: var(--card);
      padding: 18px;
      border-radius: 12px;
      border: 1px solid var(--border);
    }
    .q-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }
    .q-body {
      margin-top: 6px;
    }
    .options {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 10px;
    }
    .option {
      padding: 10px;
      border-radius: 8px;
      border: 1px dashed var(--border);
      background: #fff;
      color: inherit;
      cursor: pointer;
      font: inherit;
      text-align: left;
      width: 100%;
      transition: all 0.2s;
    }
    .option:hover {
        background: #f1f3f5;
    }
.option.selected {
      border-style: solid;
      border-color: var(--accent);
      background: #e7f1ff;
      box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
    }
    .footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 14px;
    }
    .muted {
      color: var(--muted);
    }
    .badge {
      background: var(--glass);
      border: 1px solid var(--border);
      padding: 6px 8px;
      border-radius: 8px;
      font-size: 13px;
      color: var(--muted);
    }
    .review-list {
      margin-top: 12px;
      display: grid;
      gap: 10px;
    }
    .pill {
      display: inline-block;
      padding: 6px 10px;
      border-radius: 999px;
      background: var(--glass);
      border: 1px solid var(--border);
      font-size: 13px;
    }
    .controls hr {
      border: 0;
      border-top: 1px solid var(--border);
      margin: 12px 0;
    }
    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
      gap: 10px; /* Adicionado para espaçamento */
    }
    .logo {
      display: flex;
      gap: 10px;
      align-items: center;
    }
    .logo .dot {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: linear-gradient(135deg, var(--accent), #6f42c1);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: bold;
      font-size: 1.2em;
    }
    .kbd {
      background: var(--glass);
      border: 1px solid var(--border);
      padding: 6px 8px;
      border-radius: 6px;
      font-size: 12px;
    }
    .center {
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      height: 100%;
    }
    textarea {
      min-height: 140px;
      resize: vertical;
    }
    .hint {
      font-size: 12px;
      color: var(--muted);
      margin-top: 6px;
    }
    #userDisplay {
      font-size: 14px;
      color: var(--accent);
      margin-top: 10px;
      text-align: right;
    }
    @media(max-width:900px){
        .app{
            grid-template-columns:1fr;
            padding:12px
        }
    }

    .user-menu {
      position: relative;
      display: inline-block;
    }

    .dropdown-content {
      display: none;
      position: absolute;
      right: 0;
      background-color: var(--card);
      min-width: 160px;
      box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
      z-index: 1;
      border-radius: 8px;
      border: 1px solid var(--border);
    }

    .dropdown-content a {
      color: var(--text);
      padding: 12px 16px;
      text-decoration: none;
      display: block;
    }

    .dropdown-content a:hover {background-color: var(--glass);}

    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }

    .modal-content {
      background: var(--card);
      padding: 24px;
      border-radius: 12px;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
      max-width: 400px;
      width: 100%;
      text-align: center;
    }

    .modal-actions {
      display: flex;
      gap: 12px;
      justify-content: center;
      margin-top: 20px;
    }

/* === Ajustes visuais para novas páginas === */
.app {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 4px; /* tightened spacing under header for all pages */
}

.option:focus-visible, button:focus-visible, a:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.field-help {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  margin: -4px 0 8px;
}

.time-estimate {
  background: #f3f7ff;
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  color: #334155;
  padding: 10px 12px;
}

/* === Configuração do simulado === */
.simulation-panel {
  width: min(620px, calc(100vw - 32px));
  max-width: 620px;
  padding: 28px;
  box-sizing: border-box;
}

.simulation-heading {
  margin-bottom: 24px;
}

.simulation-heading .eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.simulation-heading h1 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  line-height: 1.25;
}

.simulation-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.simulation-panel .controls {
  display: grid;
  gap: 24px;
}

.form-section {
  display: grid;
  gap: 18px;
  padding: 0;
  border: 0;
}

.form-section + .form-section {
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.form-section h2 {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-field {
  display: grid;
  gap: 7px;
}

.simulation-panel .form-field label {
  margin: 0;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 600;
}

.simulation-panel select {
  min-height: 44px;
  background: #fff;
}

.simulation-panel .field-help {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-label-row output {
  min-width: 34px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e7f1ff;
  color: #0759b5;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.range-row,
.select-with-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.range-row input[type="range"],
.select-with-hint select {
  flex: 1;
  min-width: 0;
}

.range-row input[type="range"] {
  margin: 5px 0;
  accent-color: var(--accent);
}

.plan-hint {
  display: none;
  flex: 0 0 auto;
  color: #64748b;
  font-size: 0.75rem;
  white-space: nowrap;
}

.simulation-panel .time-estimate {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.4;
}

.simulation-panel .time-estimate::before {
  content: "◷";
  margin-right: 5px;
  color: var(--accent);
}

.simulation-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.simulation-actions #startBtn {
  order: 1;
}

.simulation-actions #trainRedacaoBtn {
  order: 2;
}

@media (max-width: 560px) {
  .simulation-panel {
    width: calc(100vw - 24px);
    padding: 22px 18px;
  }

  .simulation-actions {
    grid-template-columns: 1fr;
  }

  .range-row,
  .select-with-hint {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

.modal-open { overflow: hidden; }

.analytics-consent-banner {
  position: fixed;
  z-index: 2000;
  right: 18px;
  bottom: 18px;
  max-width: 480px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 12px 36px rgba(15, 23, 42, .22);
}
.analytics-consent-banner p { margin: 0 0 12px; line-height: 1.45; }
.analytics-consent-banner div { display: flex; justify-content: flex-end; gap: 8px; }
.legal-acceptance-notice {
  position: fixed;
  z-index: 1990;
  left: 50%;
  top: 90px;
  transform: translateX(-50%);
  width: min(620px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 12px 36px rgba(15, 23, 42, .22);
}
.legal-acceptance-notice h2 { margin-top: 0; }

.header {
  text-align: center;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.footer-tutor {
  display: flex;
  justify-content: space-between;
}

/* ========= LANDING PAGE STYLES ========= */
.landing-page {
    font-family: 'Poppins', sans-serif;
    background-color: #FFFFFF;
    color: #111827;
}

.landing-page .logo strong {
    font-weight: 600;
}

.landing-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    /* slightly smaller vertical padding to reduce gap between header and content */
    padding: 10px 6%;
    position: sticky;
    top: 0;
    z-index: 10;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #4B5563;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-buttons {
    display: flex;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.landing-page .btn-primary {
    background-color: var(--accent);
    color: #FFFFFF;
}

.landing-page .btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: transparent;
    color: #111827;
    border: 1px solid #E5E7EB;
}

.btn-secondary:hover {
    background-color: #F3F4F6;
}

.hero {
    text-align: center;
    padding: 80px 20px;
    background-color: #F9FAFB;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
    margin: 0 0 16px;
}

.hero-subtitle {
    font-size: 18px;
    color: #4B5563;
    margin-bottom: 32px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.features-section {
    padding: 80px 8%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.feature-card {
    background-color: #FFFFFF;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.feature-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-description {
    color: #4B5563;
    line-height: 1.6;
}

.cta-section {
    background-color: var(--accent);
    color: #FFFFFF;
    padding: 80px 20px;
    text-align: center;
}

.cta-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-subtitle {
    font-size: 18px;
    margin-bottom: 32px;
    opacity: 0.9;
}

.cta-section .btn-primary {
    background-color: #FFFFFF;
    color: var(--accent);
}

.cta-section .btn-primary:hover {
    background-color: #F3F4F6;
}

.landing-footer {
    text-align: center;
    padding: 40px 20px;
    background-color: #F9FAFB;
    border-top: 1px solid #E5E7EB;
    color: #6B7280;
    margin-top: auto;
    background: #FFFFFF;
    padding: 16px 8%;
    border-top: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
}

/* When landing header exists, ensure the immediate app content sits close below it */
header.landing-header + .app {
  padding-top: 6px !important; /* force small gap under header */
}

/* Stronger override for spacing when landing header is present (helps if other rules still apply) */
header.landing-header + .app {
  padding-top: 6px !important; /* force small gap under header */
}
.landing-header {
  padding-bottom: 6px !important; /* reduce header vertical padding if still large */
}

/* === Estilos para a página de Conta === */
.account-section {
  background-color: #f8f9fa; /* Usando a cor de fundo principal para contraste */
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.account-section h2 {
  margin-top: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 20px;
  font-size: 1.1em;
  color: var(--text);
}

.subscription-status {
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  text-align: center;
  font-weight: 500;
}

/* Cores de status para tema claro */
.status-active {
    background-color: #e7f1ff;
    color: #0056b3;
    border: 1px solid #b3d1ff;
}
.status-canceled {
    background-color: #fff0f0;
    color: #d93b3b;
    border: 1px solid #ffb3b3;
}
.status-free {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}



/* Remove app padding for landing page */
.landing-page .app {
    max-width: none;
    padding: 0;
}

/* Reset body margin */
.landing-page body {
    margin: 0;
}

/* ========= MEDIA QUERIES FOR RESPONSIVENESS ========= */
@media (max-width: 768px) {
    /* Header adjustments */
    .landing-nav {
        flex-direction: column; /* Stack logo, links, and buttons vertically */
        gap: 20px;
    }

    .nav-links {
        order: 3; /* Move links to the bottom */
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 0; /* Remove default padding */
    }

    .nav-buttons {
        order: 2; /* Move buttons to the middle */
    }

    /* Typography adjustments */
    .hero-title {
        font-size: 32px; /* Reduce font size for hero title */
    }

    .section-title,
    .cta-title {
        font-size: 28px; /* Reduce font size for section titles */
    }

    /* Padding adjustments for sections */
    .hero,
    .features-section,
    .cta-section {
        padding: 60px 5%; /* Reduce horizontal padding */
    }

    .features-grid {
        grid-template-columns: 1fr; /* Ensure a single column for feature cards */
        gap: 20px;
    }
}

/* === MODAL DE LOADING === */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--glass);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========= Example Section Styles ========= */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}

.example-frame {
    background-color: #F9FAFB;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: left;
}

.example-frame h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.example-frame .small {
    margin-bottom: 16px;
    display: block;
}

/* Mockup Question Card */
.mockup-question-card {
    background: var(--card);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-size: 14px;
}
.mockup-question-card p {
    margin: 0 0 12px 0;
    font-weight: 600;
}
.mockup-option {
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 4px;
}
.mockup-option.correct {
    background-color: #e0f2f1; /* Light teal background */
    font-weight: 600;
}
.mockup-explanation {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 12px;
    font-size: 13px;
}

/* Mockup Essay Card */
.mockup-essay-card {
    background: var(--card);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.mockup-competency {
    border-left: 4px solid #28a745; /* Green border */
    padding-left: 12px;
    font-size: 14px;
}
.mockup-competency h5 {
    margin: 0 0 4px 0;
    font-weight: 600;
}
.mockup-score-circle {
    margin: 20px auto 0 auto;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.mockup-score-circle span {
    font-size: 28px;
    font-weight: 700;
}
.mockup-score-label {
    font-size: 12px;
}

/* Mockup Report Card */
.mockup-report-card {
    background: var(--card);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
}
.mockup-report-card h5 {
    margin: 0 0 16px 0;
    font-weight: 600;
}
.mockup-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 120px;
    border-left: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
    padding: 0 10px;
}
.mockup-bar {
    width: 25%;
    background-color: #28a745; /* Green for positive trend */
    border-radius: 4px 4px 0 0;
    position: relative;
    display: flex;
    justify-content: center;
}
.mockup-bar-label {
    position: absolute;
    bottom: -20px;
    font-size: 12px;
    color: var(--muted);
}
.mockup-stat {
    margin-top: 30px;
}
.mockup-stat strong {
    font-size: 24px;
    display: block;
    color: #28a745;
}
.mockup-stat span {
    font-size: 14px;
    color: var(--muted);
}

/* --- Payment Summary --- */
.payment-summary {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background-color: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.payment-summary .plan-name-display {
    font-size: 1.1em;
    color: var(--muted);
    margin-bottom: 12px;
}
.payment-summary .price-display {
    display: flex;
    justify-content: center;
    align-items: baseline;
    margin-bottom: 12px;
    color: var(--text);
}
.payment-summary .price-display .amount {
    font-size: 2.8em;
    font-weight: 600;
}
.payment-summary .price-display .period {
    font-size: 1.1em;
    color: var(--muted);
    margin-left: 8px;
}
.payment-summary .recurring-notice {
    font-size: 0.9em;
    color: var(--muted);
}


/* ========= New Example Section Styles ========= */
.mockup-window {
    border-radius: 8px;
    background-color: var(--card);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border: 1px solid var(--border);
    margin-top: 20px;
    overflow: hidden;
}

.mockup-header {
    background-color: #e8e6e8;
    padding: 8px;
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
}

.mockup-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ddd;
}
.mockup-dot:nth-child(1) { background-color: #f96256; }
.mockup-dot:nth-child(2) { background-color: #fdbc3d; }
.mockup-dot:nth-child(3) { background-color: #33c648; }

.mockup-content {
    padding: 16px;
}

.mockup-question-card, .mockup-essay-card, .mockup-report-card {
    box-shadow: none;
    padding: 0; /* Reset padding as it's now on mockup-content */
}
