/* VID Provisional Q&A — Custom Portal Styles
   This stylesheet layers on top of Pico.css to provide branding and polished UI. */

:root {
  --brand: #14532d; /* dark green */
  --brand-600: #166534;
  --brand-700: #064e3b;
  --accent: #22c55e; /* green-500 */
  --danger: #ef4444; /* red-500 */
  --warning: #f59e0b; /* amber-500 */
  --muted: #64748b;  /* slate-500 */
  --bg-soft: #f8fafc; /* slate-50 */
  --card: #ffffff;
  --ring: rgba(22, 101, 52, 0.25);
  --shadow: 0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
  --radius: 12px;
}

/* Layout */
html, body { height: 100%; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #000;
}

header.container {
  padding-top: 1.25rem;
  padding-bottom: 1rem;
}

header h3 {
  color: #000;
  letter-spacing: 0.2px;
}

/* Navbar */
/* Navbar */
nav ul {
  display: flex;
  gap: .4rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  justify-content: space-between; /* spread items across full width on desktop */
  align-items: center;
}

.site-header .main-nav { width: 100%; }
.site-header .main-nav ul { width: 100%; }
.site-header .main-nav ul li { flex: 1 1 0; }
.site-header .main-nav ul li a { display: block; text-align: center; width: 100%; }

/* On narrow screens, don't force equal widths; allow scroll */
@media (max-width: 768px) {
  .site-header .main-nav ul { justify-content: flex-start; }
  .site-header .main-nav ul li { flex: 0 0 auto; }
}

nav a {
  border-radius: 8px;
  padding: .35rem .6rem;
  text-decoration: none;
  color: var(--brand);
}

nav a:hover {
  background: #f3f4f6; /* neutral hover */
  color: var(--brand);
}

/* Hero */
.hero {
  background: #ffffff; /* removed green tint */
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.hero h2 {
  margin-bottom: .5rem;
  color: #000;
}

.hero p {
  color: #000;
}

.hero a[role="button"] {
  background: var(--brand);
  border-color: var(--brand);
}

.hero a[role="button"]:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
}

/* Cards */
.question-card,
article.card,
.page-card {
  background: #ffffff; /* reverted to white surface */
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

/* Tables */
table {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

table thead {
  background: #f1f5f9; /* slate-100 */
}

table th {
  color: #000;
}

/* Buttons */
a[role="button"],
button,
input[type="submit"] {
  border-radius: 10px;
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Forms */
label {
  font-weight: 600;
}

/* Ensure all text fields have a white background and clear borders */
input, select, textarea {
  border-radius: 10px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1; /* slate-300 */
  color: #000 !important;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--ring);
  background: #ffffff !important;
}

/* Improve visibility when disabled/read-only while keeping white bg */
input:disabled, select:disabled, textarea:disabled,
input[readonly], textarea[readonly] {
  background: #ffffff !important;
  color: #000 !important;
  opacity: 0.8;
}

/* Fight browser autofill yellow to keep white background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #000;
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
  box-shadow: 0 0 0px 1000px #ffffff inset;
}

/* Feedback / Messages */
article.success { border-left: 4px solid var(--accent); }
article.error { border-left: 4px solid var(--danger); }
article.warning { border-left: 4px solid var(--warning); }

/* Make success activation message text white and readable */
article.success {
  color: #fff !important;
  background: #16a34a; /* green-600 for contrast */
}

/* Exam timer */
.timer {
  font-weight: 700;
  color: var(--danger);
}
/* Sticky timer bar on test page */
.timer-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #dcfce7; /* light green background */
  border-bottom: 1px solid #86efac; /* soft green border */
  padding: .75rem 1rem; /* slightly larger padding */
  margin: -1rem -1.1rem 1rem -1.1rem; /* stretch to card edges */
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  display: flex;
  gap: .5rem;
  align-items: center;
  font-weight: 800; /* bold */
  font-size: 1.15rem; /* bigger text for the whole bar */
}
/* Make the numeric timer slightly larger and keep urgency color */
.timer-sticky .timer { color: var(--danger); font-size: 1.3rem; font-weight: 900; }

/* Results icons */
.status-icon { font-weight: 800; margin-right: .35rem; }
.icon-check { color: #16a34a !important; font-weight: 700; } /* success green */
.icon-x { color: #dc2626 !important; font-weight: 700; } /* danger red */

/* Images inside questions */
.question-card img {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow);
  margin-top: .5rem;
}

/* Footer */
main.container { flex: 1 0 auto; }
footer.container {
  color: #000;
  margin-top: auto;
}

/* Utilities */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.my-1 { margin-block: .5rem !important; }
.my-2 { margin-block: 1rem !important; }
.p-0 { padding: 0 !important; }
.py-2 { padding-block: 1rem !important; }
.text-muted { color: #000 !important; }
.text-brand { color: #000 !important; }

/* Dashboard feature cards */
.grid article header {
  color: var(--brand-700);
  font-weight: 700;
}

.grid article {
  background: #ffffff; /* reverted to white */
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}


/* High-contrast text adjustments: make any grey text fully black for visibility */
:root {
  --muted: #111111; /* darker muted to avoid faded grey */
}

/* Force common text elements to render black, overriding Pico defaults */
body, p, small, span, li, td, th, label, legend, details, summary {
  color: #000 !important;
}

/* Branding subtitle and footer text */
header .branding .site-subtitle,
footer small {
  color: #000 !important;
}

/* Form fields and placeholders */
input, select, textarea {
  color: #000 !important;
}
input::placeholder,
textarea::placeholder {
  color: #000 !important;
  opacity: 1; /* ensure not faded */
}

/* Tables: ensure body cells are solid black as well */
table tbody td {
  color: #000 !important;
}




/* ----- Enforce white backgrounds everywhere (homepage black strip fix) ----- */
html { background: #ffffff !important; color-scheme: light; }
body { background: #ffffff !important; }

/* Ensure structural sections never inherit dark backgrounds from Pico or OS */
header.container,
.site-header,
.main-nav,
main.container,
footer.container { background: #ffffff !important; }

/* Cards and content blocks */
.page-card,
.question-card,
.grid article,
.hero,
.table,
table { background: #ffffff !important; }

/* Remove any unintended dark fills from generic <footer> or <header> outside .container */
header, footer { background: #ffffff !important; }

/* Keep HR subtle on white */
footer.container hr, hr { border-color: #e5e7eb !important; color: #e5e7eb !important; }


/* --- Dashboard Q&A: enforce white backgrounds (no dark/black) --- */
.dashboard-sample .table,
.dashboard-sample table,
.dashboard-sample .table thead,
.dashboard-sample .table tbody,
.dashboard-sample .table tr,
.dashboard-sample .table th,
.dashboard-sample .table td {
  background: #ffffff !important;
}

/* Remove zebra striping darkness entirely */
.dashboard-sample .table-striped tbody tr:nth-child(odd),
.dashboard-sample .table-striped tbody tr:nth-child(even) {
  background: #ffffff !important;
}

/* Neutralize hover to stay white (or very light) */
.dashboard-sample .table-hover tbody tr:hover {
  background: #ffffff !important; /* keep white to avoid any dark strip */
}

/* Card view (mobile) blocks should also be white */
.dashboard-sample .question-card .card-header,
.dashboard-sample .question-card .card-body,
.dashboard-sample .answer-option,
.dashboard-sample .correct-answer {
  background: #ffffff !important;
}

/* --- Exam Preparation: enforce white backgrounds and neutral borders --- */
.exam-prep,
.exam-prep * {
  background: #ffffff !important;
}
.exam-prep table thead,
.exam-prep table tbody,
.exam-prep table tr,
.exam-prep table th,
.exam-prep table td {
  background: #ffffff !important;
}
.exam-prep table tbody tr:nth-child(odd),
.exam-prep table tbody tr:nth-child(even),
.exam-prep table.table-striped tbody tr:nth-child(odd),
.exam-prep table.table-striped tbody tr:nth-child(even) {
  background: #ffffff !important;
}
.exam-prep table.table-hover tbody tr:hover {
  background: #ffffff !important;
}
.exam-prep table {
  border: 1px solid #e5e7eb !important;
}
.exam-prep table th,
.exam-prep table td {
  border-color: #e5e7eb !important;
  color: #000 !important;
}


/* --- Typography adjustments (smaller base font and bold navbar) --- */
html {
  /* Reduce base size further so overall text is smaller */
  font-size: 14px;
}
/* Keep desktops readable while still smaller than before */
@media (min-width: 1280px) {
  html { font-size: 14.5px; }
}

/* Make navbar labels bold as requested */
.site-header .main-nav a {
  font-weight: 700 !important;
}

/* Tame heading sizes for the new base size */
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.9rem; }



/* --- Header/Branding and Navbar font size increases (scoped) --- */
header.container .branding .site-title {
  font-size: 1.75rem; /* larger brand title */
  line-height: 1.2;
}
header.container .branding .site-subtitle {
  font-size: 1.05rem; /* slightly larger subtitle */
}
/* Navbar items: keep bold, bump size slightly without affecting other text */
.site-header .main-nav a {
  font-size: 1.05rem;
}
@media (min-width: 1280px) {
  header.container .branding .site-title { font-size: 1.9rem; }
  header.container .branding .site-subtitle { font-size: 1.1rem; }
  .site-header .main-nav a { font-size: 1.08rem; }
}


/* --- Exam Preparation page: brand buttons for Start/Unlock --- */
.exam-prep a[role="button"] {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #ffffff !important;
}
.exam-prep a[role="button"]:hover,
.exam-prep a[role="button"]:focus {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  color: #ffffff !important;
}


/* --- Flash messages: ensure non-black readable backgrounds --- */
article.warning {
  background: #fef3c7 !important; /* light amber */
  color: #000 !important;        /* readable on light bg */
  border-left-color: #f59e0b !important; /* match warning color */
}
article.info {
  background: #e0f2fe !important; /* light blue */
  color: #000 !important;
  border-left-color: #38bdf8 !important;
}


/* --- Flash messages: danger (error) styling --- */
article.error {
  background: #fee2e2 !important; /* light red danger background */
  color: #000 !important;         /* high-contrast text */
  border-left-color: var(--danger) !important; /* keep red accent */
}


/* --- Results page answer emphasis --- */
.success-text { color: #16a34a !important; font-weight: 700; }
.warning-text { color: #dc2626 !important; font-weight: 700; }


/* Emphasize whole review items by correctness */
.question-card.warning { border-left: 4px solid var(--warning) !important; }
.question-card.success { border-left: 4px solid var(--accent) !important; }

/* Header branding adjustments */
.site-header .branding .site-title {
  color: var(--brand);
  margin-bottom: 0;
}
.site-header .branding .site-subtitle {
  color: #14532d !important;
  font-weight: 700;
  display: block;
}
.site-header .branding img {
  height: 64px;
  width: auto;
}
@media (max-width: 600px) {
  .site-header .branding img { height: 52px; }
}


/* --- Pricing page layout --- */
.pricing-page {
  background: transparent; /* keep parent white cards */
}
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 900px) {
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
}

.pricing-page .plan-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: 100%;
}
.pricing-page .plan-card .card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.25rem;
}
.pricing-page .plan-card h4,
.pricing-page .plan-card h1,
.pricing-page .plan-card h5,
.pricing-page .plan-card p {
  text-align: center;
}
.pricing-page .plan-card table td {
  padding: .25rem .5rem;
  vertical-align: top;
}
.pricing-page .plan-card .d-grid { width: 100%; }
.pricing-page .plan-card a[role="button"] {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
}
.pricing-page .plan-card a[role="button"]:hover {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
}


/* --- Results page: score badge pass/fail backgrounds --- */
.score-badge {
  color: #ffffff !important;
}
.score-badge.pass {
  background: var(--brand) !important; /* dark green */
  border: 1px solid var(--brand-700) !important;
}
.score-badge.fail {
  background: var(--danger) !important; /* red */
  border: 1px solid #b91c1c !important; /* red-700 */
}

/* --- Test carousel: make Previous/Next buttons longer --- */
.slides-controls #prevBtn,
.slides-controls #nextBtn {
  min-width: 150px;
  padding: 0.65rem 1.25rem;
}


/* --- Test page: Question Navigator (answered/skipped jump list) --- */
.q-navigator {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.q-nav-item {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #111827;
  border-radius: 999px;
  min-width: 2rem;
  height: 2rem;
  padding: 0 .5rem;
  line-height: 1.9rem;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
}
.q-nav-item:hover { background: #e5e7eb; }
.q-nav-item.active {
  outline: 2px solid var(--ring);
  border-color: var(--brand);
}
.q-nav-item.answered {
  background: var(--brand) !important; /* success background */
  border-color: var(--brand-700) !important;
  color: #ffffff !important;
}
.q-nav-item.skipped {
  background: #fef3c7 !important; /* amber-100 warning */
  border-color: #f59e0b !important; /* amber-500 */
  color: #7c2d12 !important; /* amber-900 for contrast */
}
.q-nav-legend {
  margin-top: .25rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.q-nav-legend .legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.q-nav-legend .dot {
  display: inline-block;
  width: .75rem; height: .75rem; border-radius: 999px; border: 1px solid #e5e7eb;
}
.q-nav-legend .dot.answered { background: #dcfce7; border-color: var(--brand); }
.q-nav-legend .dot.skipped { background: #fee2e2; border-color: #fecaca; }


/* --- Dashboard hero typography boost (tamed size, forced white) --- */
.dashboard-hero h2 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff; /* ensure white heading on banner */
}
.dashboard-hero p {
  font-size: 1.1rem;
  font-weight: 600;
}
@media (min-width: 768px) {
  .dashboard-hero h2 { font-size: 2.1rem; }
  .dashboard-hero p { font-size: 1.2rem; }
}
@media (min-width: 1280px) {
  .dashboard-hero h2 { font-size: 2.3rem; }
  .dashboard-hero p { font-size: 1.25rem; }
}


/* === Global brand button styles (green) === */
button,
a[role="button"],
input[type="submit"],
input[type="button"],
.input[type="reset"],
.btn {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #ffffff !important;
}
button:hover,
a[role="button"]:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.btn:hover,
button:focus,
a[role="button"]:focus,
input[type="submit"]:focus,
input[type="button"]:focus,
.btn:focus {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  color: #ffffff !important;
}

/* Secondary buttons: outline green on white */
button.secondary,
a.secondary[role="button"],
.secondary.button,
button.secondary:where(:not([disabled])),
a[role="button"].secondary:where(:not([aria-disabled="true"])) {
  background: #ffffff !important;
  color: var(--brand) !important;
  border: 1px solid var(--brand) !important;
}
button.secondary:hover,
a.secondary[role="button"]:hover,
button.secondary:focus,
a.secondary[role="button"]:focus {
  background: #f3f4f6 !important;
  color: var(--brand) !important;
  border-color: var(--brand-600) !important;
}

/* Disabled buttons: keep readable */
button[disabled],
a[aria-disabled="true"][role="button"],
button[disabled].secondary {
  opacity: .6;
  cursor: not-allowed;
}

/* === Responsive navbar with hamburger === */
.nav-toggle {
  display: none;
  background: transparent !important;
  color: var(--brand) !important;
  border: 1px solid #e5e7eb !important;
  padding: .35rem .6rem;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .site-header .main-nav ul {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
    margin-top: .5rem;
  }
  .site-header .main-nav.open ul { display: flex; }

  /* Make nav links full-width on mobile */
  .site-header .main-nav ul li { width: 100%; }
  .site-header .main-nav ul li a { text-align: left; width: 100%; }
}

@media (min-width: 901px) {
  .nav-toggle { display: none; }
  /* Ensure desktop nav is visible */
  .site-header .main-nav ul { display: flex !important; }
}
