/*
 * Readiness Platform | Corporate green theme
 * Palette preserved from the original student website (style.css):
 * #004733, #1b5e20, #2e7d32, #66bb6a, #e8f5e9, #c8e6c9
 * Single stylesheet for public pages, student quizzes and administrator area.
 */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
  --green-900: #004733;
  --green-850: #07543c;
  --green-800: #1b5e20;
  --green-700: #2e7d32;
  --green-500: #66bb6a;
  --green-100: #e8f5e9;
  --green-200: #c8e6c9;
  --green-50: #f5faf5;
  --ink: #18352c;
  --body-text: #40584b;
  --muted: #64786b;
  --line: #dce7de;
  --paper: #ffffff;
  --page: #f7f9f7;
  --error: #ad3636;
  --error-tint: #fff2f0;
  --warn: #835a19;
  --warn-tint: #fff8e9;
  --radius: 9px;
  --shadow: 0 3px 14px rgba(0, 52, 36, .035);
  /* Compatibility for existing PHP components */
  --forest: var(--green-900);
  --forest-dark: #003b2a;
  --mint: var(--green-100);
  --canvas: var(--page);
  --red: var(--error);
  --red-soft: var(--error-tint);
  --amber: var(--warn);
  --amber-soft: var(--warn-tint);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--ink);
  font: 400 15px/1.8 'Cairo', Tahoma, Arial, sans-serif; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, textarea, select { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--green-700); }
h1,h2,h3,h4 { color: var(--ink); font-weight: 800; line-height: 1.4; }
h1,h2,h3,p { overflow-wrap: anywhere; }
.shell { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }

/* The compact dark strip and restrained navigation echo institutional websites. */
.utility-bar { background: var(--green-900); color: #e8f5e9; }
.utility-inner { min-height: 32px; display: flex; align-items: center; justify-content: space-between;
  gap: 18px; font-size: 11px; font-weight: 600; letter-spacing: .01em; }
.utility-inner span:last-child { opacity: .88; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 15; }
.header-inner { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.brand-logo { width: 51px; height: 55px; object-fit: contain; }
.brand > span { border-right: 2px solid var(--green-500); padding-right: 13px; line-height: 1.65; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 21px; color: var(--green-900); font-weight: 800; }
.brand small { font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.main-nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: clamp(14px, 2vw, 28px); }
.main-nav a { position: relative; padding: 27px 0 25px; color: #455d50;
  font-size: 13px; font-weight: 700; white-space: nowrap; transition: color .18s ease; }
.main-nav a:not(.admin-link)::after { position: absolute; content: ''; right: 0; bottom: 17px;
  width: 100%; height: 2px; background: var(--green-700); opacity: 0; transform: scaleX(.5); transition: .18s; }
.main-nav a.active, .main-nav a:hover { color: var(--green-900); }
.main-nav a.active::after, .main-nav a:hover::after { opacity: 1; transform: scaleX(1); }
.main-nav a.admin-link { background: var(--green-900); color: #fff; border: 1px solid var(--green-900);
  border-radius: 6px; margin-inline-start: 2px; padding: 8px 17px; }
.main-nav a.admin-link:hover { background: var(--green-800); }
.menu-toggle { display: none; background: #fff; color: var(--green-900); border: 1px solid var(--line);
  border-radius: 5px; padding: 7px 13px; font-size: 13px; font-weight: 700; }

/* Main landing section */
.hero { background: var(--green-50); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.02fr; align-items: center;
  gap: clamp(38px, 5vw, 72px); padding-block: 66px 70px; }
.eyebrow { display: block; color: var(--green-700); font-size: 12px; font-weight: 800;
  margin-bottom: 12px; line-height: 1.8; }
.hero-copy { padding-right: 20px; border-right: 3px solid var(--green-500); }
.hero-copy h1 { margin: 0 0 18px; font-size: clamp(34px, 3.4vw, 47px);
  line-height: 1.4; letter-spacing: -.4px; max-width: 540px; color: var(--green-900); }
.hero-copy p { max-width: 515px; font-size: 16px; line-height: 1.95; margin: 0 0 28px; color: var(--body-text); }
.hero-actions, .form-actions, .admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hero-actions.center { justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px;
  padding: 9px 20px; border-radius: 6px; border: 1px solid transparent;
  font-size: 13px; line-height: 1.55; font-weight: 800; text-align: center; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }
.btn-primary { background: var(--green-900); border-color: var(--green-900); color: #fff; }
.btn-primary:hover { background: var(--green-800); border-color: var(--green-800); box-shadow: 0 3px 9px rgba(0, 71, 51, .12); }
.btn-outline { background: #fff; border-color: #b5d1b9; color: var(--green-900); }
.btn-outline:hover { background: var(--green-100); }
.btn-light { background: #fff; color: var(--green-900); border-color: #fff; }
.btn-light:hover { background: var(--green-100); }
.btn-small { min-height: 36px; padding: 7px 13px; font-size: 12px; }
.btn-danger { background: #fff; color: var(--error); border-color: #e6c4c2; }
.btn-danger:hover { background: var(--error-tint); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0; margin-top: 30px; color: #516e5a;
  font-size: 12px; font-weight: 700; }
.hero-meta span { padding-inline: 13px; line-height: 1.5; border-left: 1px solid #bed6c1; }
.hero-meta span:first-child { padding-right: 0; }
.hero-meta span:last-child { border: 0; }
.hero-image { position: relative; min-height: 344px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid #cadccc; box-shadow: 0 12px 30px rgba(0, 52, 36, .09); background: #e2ede4; }
.hero-image > img { width: 100%; height: 396px; object-fit: cover; }
.image-label { position: absolute; bottom: 17px; right: 17px; background: var(--green-900); color: #fff;
  padding: 8px 15px; font-size: 12px; font-weight: 700; border-radius: 5px; }

/* Shared sections and cards */
.section { padding-block: 64px; }
.section-small { padding-top: 8px; padding-bottom: 72px; }
.section-heading { display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 26px; gap: 24px; }
.section-heading h2 { margin: 0; font-size: 27px; }
.section-heading p { font-size: 13px; line-height: 1.8; max-width: 380px; color: var(--muted); margin: 0; }
.feature-grid, .track-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.feature-card, .track-card, .topic-card, .panel, .stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.feature-card { position: relative; padding: 27px 27px 29px; border-top: 2px solid var(--green-700); min-height: 225px; }
.feature-number { display: block; width: 35px; height: 31px; border: 1px solid var(--green-200); background: var(--green-100);
  font: 800 12px/29px 'Cairo',Tahoma,sans-serif; text-align: center; border-radius: 4px; color: var(--green-700); }
.feature-card h3 { font-size: 19px; margin: 17px 0 9px; }
.feature-card p, .track-card p { color: var(--muted); font-size: 13px; line-height: 1.95; margin: 0 0 17px; }
.feature-card a { color: var(--green-700); font-size: 13px; font-weight: 800; }
.feature-card a:hover { text-decoration: underline; }
.banner { min-height: 166px; display: flex; align-items: center; justify-content: space-between;
  gap: 28px; padding: 30px 38px; border: 1px solid var(--green-900);
  border-right: 4px solid var(--green-500); border-radius: var(--radius); background: var(--green-900); color: #fff; }
.banner .eyebrow { color: #c3edca; margin-bottom: 5px; }
.banner h2 { margin: 0 0 3px; color: #fff; font-size: 25px; }
.banner p { color: #d5e7d8; margin: 0; font-size: 13px; }
.site-footer { background: var(--green-900); border-top: 2px solid var(--green-500);
  color: #d5e7d8; padding: 24px 0; font-size: 12px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-inner p { margin: 0; }
.footer-inner strong { color: #fff; }
.footer-inner a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.section-head { max-width: 910px; padding-bottom: 22px; border-bottom: 1px solid var(--line);
  margin-bottom: 30px; border-right: 3px solid var(--green-500); padding-right: 19px; }
.section-head .eyebrow { margin-bottom: 4px; }
.section-head h1 { margin: 0 0 8px; font-size: 31px; color: var(--green-900); }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.85; }
.panel { padding: 28px; }
.content-panel { font-size: 15px; line-height: 2.15; }
.content-panel p { margin: 0 0 14px; }
.muted { color: var(--muted)!important; }
.top-gap { margin-top: 42px; }
.topic-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.topic-card { min-height: 145px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 26px; box-shadow: none; transition: border-color .16s ease, background .16s ease; }
.topic-card:hover { border-color: var(--green-500); background: #fbfefb; }
.topic-card strong { color: var(--ink); font-size: 16px; }
.topic-card small { color: var(--muted); font-size: 12px; }
.topic-dot { display: block; width: 32px; height: 3px; margin-bottom: 7px; background: var(--green-500); }
.crumb { margin-bottom: 22px; font-size: 12px; color: var(--muted); }
.crumb a { color: var(--green-700); font-weight: 800; }
.notice { background: var(--green-50); border: 1px solid var(--green-200); border-right: 3px solid var(--green-700);
  color: var(--green-900); border-radius: 6px; padding: 14px 18px; margin-bottom: 20px; font-size: 13px; }
.notice.success { background: var(--green-100); border-color: var(--green-200); }
.notice.error { background: var(--error-tint); border-color: #e8bbbb; border-right-color: var(--error); color: var(--error); }
.notice.warning { background: var(--warn-tint); border-color: #ecd9ab; border-right-color: var(--warn); color: var(--warn); }
.notice.info { background: #f2f8f3; }
.image-gallery { display: grid; max-width: 880px; gap: 24px; margin-bottom: 25px; }
.guide-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 20px; }
.gallery-frame { margin: 0; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.gallery-frame img { width: 100%; height: auto; object-fit: contain; border-radius: 5px; }
.gallery-frame figcaption { font-size: 12px; text-align: center; color: var(--muted); margin-top: 10px; }
.track-card { position: relative; display: flex; flex-direction: column; align-items: start;
  min-height: 312px; padding: 28px; border-top: 2px solid var(--green-700); }
.track-card h2 { margin: 0 0 11px; font-size: 21px; }
.track-card p { flex: 1; }
.track-card .btn { margin-top: 15px; }
.track-index { display: grid; place-items: center; background: var(--green-100); color: var(--green-900);
  border: 1px solid var(--green-200); border-radius: 6px; font: 800 17px/1 'Cairo',Tahoma,sans-serif;
  width: 52px; height: 52px; margin-bottom: 20px; }
.note-inline { color: var(--muted); font-size: 12px; margin-top: 22px; }

/* Quiz and forms */
.narrow { max-width: 910px; }
.narrow-panel { max-width: 710px; }
.student-card { margin-bottom: 29px; display: flex; flex-direction: column; gap: 9px;
  border-top: 2px solid var(--green-700); }
.student-card label { font-weight: 800; }
.student-card small { font-size: 12px; color: var(--muted); }
.required { color: var(--error); }
.question-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 28px 26px; margin: 0 0 18px; min-width: 0; box-shadow: var(--shadow); }
.question-card legend { max-width: 100%; padding: 0 7px; line-height: 2.1;
  white-space: normal; font-size: 15px; font-weight: 800; }
.q-index { display: inline-grid; place-items: center; vertical-align: middle; margin-left: 11px;
  width: 30px; height: 30px; border-radius: 5px; color: var(--green-900);
  background: var(--green-100); font-size: 12px; font-weight: 800; }
.option { display: flex; align-items: center; gap: 12px; padding: 11px 15px; margin: 9px 0;
  border-radius: 6px; border: 1px solid #e4ece5; background: #fbfdfb; font-size: 13px; cursor: pointer; }
.option:hover { border-color: var(--green-200); }
.option:has(input:checked) { background: var(--green-100); border-color: var(--green-500); }
.option input { accent-color: var(--green-700); width: 17px; height: 17px; flex: none; }
.result-panel { background: var(--green-100); border: 1px solid var(--green-200); border-radius: var(--radius);
  text-align: center; padding: 48px 28px; }
.result-panel h2 { margin: 0; font-size: 25px; }
.result-panel p { color: var(--body-text); }
.result-number { color: var(--green-900); font-size: 71px; line-height: 1.5; font-weight: 800; }
.result-number small { font-size: 25px; color: var(--muted); }
.form-panel { padding: 34px; }
.stack-form { display: flex; flex-direction: column; gap: 18px; }
.stack-form .form-field { margin-bottom: 0; }
.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 19px; }
.form-field label { color: var(--ink); font-size: 13px; font-weight: 800; }
input[type=text], input[type=email], input[type=password], input:not([type]), textarea, select {
  width: 100%; min-height: 47px; padding: 10px 14px; border: 1px solid #cddccf;
  border-radius: 6px; background: #fff; color: var(--ink); font-size: 13px; line-height: 1.65; }
input:focus, textarea:focus, select:focus { outline: 2px solid #b6ddb9; outline-offset: 1px; border-color: var(--green-700); }
textarea { resize: vertical; min-height: 104px; }
input::placeholder, textarea::placeholder { color: #83958a; }
.hidden-field { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.form-panel > .muted:first-child { margin-top: 0; }
.form-panel > .btn { margin-top: 6px; }

/* Administration: dashboard, question management, results and messages */
.admin-shell { min-height: 69vh; padding-top: 52px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin-bottom: 27px; }
.admin-toolbar .eyebrow { margin: 0 0 2px; }
.admin-toolbar h1 { color: var(--green-900); margin: 0; font-size: 29px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 30px;
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 3px 10px; }
.admin-tabs a { display: inline-block; padding: 12px 18px; border-bottom: 2px solid transparent;
  color: #5e7163; font-size: 13px; font-weight: 700; }
.admin-tabs a:hover, .admin-tabs a.selected { color: var(--green-900); border-bottom-color: var(--green-700); background: var(--green-50); }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
.stat-card { display: flex; flex-direction: column; gap: 3px; padding: 24px;
  border-right: 2px solid var(--green-700); box-shadow: none; }
.stat-card span { color: var(--body-text); font-size: 13px; font-weight: 700; }
.stat-card strong { color: var(--green-900); font-size: 34px; font-weight: 800; line-height: 1.35; }
.stat-card small { font-size: 12px; color: var(--muted); line-height: 1.7; }
.table-wrap { padding: 0; overflow-x: auto; }
.data-table { width: 100%; min-width: 650px; border-collapse: collapse; }
.data-table th, .data-table td { text-align: right; padding: 15px 18px;
  border-bottom: 1px solid #e6eee7; font-size: 13px; line-height: 1.7; vertical-align: middle; }
.data-table th { color: var(--green-900); background: var(--green-100); font-size: 12px; font-weight: 800; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f9fcf9; }
.question-cell { min-width: 225px; max-width: 410px; }
.text-center { text-align: center!important; }
.pill { display: inline-block; background: var(--green-100); color: var(--green-900);
  border: 1px solid var(--green-200); border-radius: 5px; padding: 4px 11px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.table-actions form { margin: 0; }
.admin-actions { margin-top: 24px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.filter-form { display: flex; align-items: center; gap: 12px; }
.filter-form label { font-size: 12px; color: var(--body-text); font-weight: 700; }
.filter-form select { min-width: 190px; width: auto; }
.message-list { display: flex; flex-direction: column; gap: 18px; }
.message-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.message-head p { margin: 4px 0; font-size: 12px; }
.message-body { white-space: normal; line-height: 1.95; padding: 16px 0; border-block: 1px solid var(--line); }
.empty-state { padding: 45px 20px; color: var(--muted); text-align: center; }

@media (max-width: 1040px) {
  .main-nav { gap: 15px; }
  .header-inner { flex-wrap: wrap; padding-block: 12px; }
  .main-nav a { padding-block: 9px 14px; }
  .main-nav a:not(.admin-link)::after { bottom: 8px; }
  .hero-grid { gap: 35px; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 740px) {
  .shell { width: min(100% - 32px, 1160px); }
  .utility-inner { font-size: 9px; min-height: 30px; }
  .utility-inner span:last-child { display: none; }
  .header-inner { min-height: 76px; padding-block: 11px; gap: 10px; }
  .brand { gap: 6px; }
  .brand-logo { width: 39px; height: 45px; }
  .brand > span { padding-right: 8px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 9px; }
  .menu-toggle { display: inline-flex; }
  .main-nav { display: none; width: 100%; align-items: stretch; flex-direction: column;
    gap: 0; background: #fff; border-top: 1px solid var(--line); padding-bottom: 10px; }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 11px 12px; }
  .main-nav a:not(.admin-link)::after { display: none; }
  .main-nav a.active { border-right: 3px solid var(--green-700); background: var(--green-100); }
  .main-nav a.admin-link { margin-inline: 0; text-align: center; }
  .hero-grid { grid-template-columns: 1fr; padding-block: 46px 54px; gap: 30px; }
  .hero-copy { padding-right: 14px; }
  .hero-copy h1 { font-size: 30px; line-height: 1.45; }
  .hero-copy p { font-size: 14px; line-height: 1.85; }
  .hero-image { min-height: auto; box-shadow: 0 8px 22px rgba(0, 52, 36, .08); }
  .hero-image>img { height: 268px; }
  .hero-meta { gap: 10px 0; }
  .section { padding-block: 44px; }
  .section-small { padding-top: 0; padding-bottom: 48px; }
  .section-heading, .footer-inner { align-items: flex-start; flex-direction: column; gap: 7px; }
  .section-heading h2 { font-size: 23px; }
  .section-head h1 { font-size: 27px; }
  .feature-grid, .track-grid, .topic-grid, .guide-grid { grid-template-columns: 1fr; }
  .feature-card, .track-card { min-height: auto; }
  .banner { align-items: flex-start; flex-direction: column; padding: 25px; }
  .banner h2 { font-size: 22px; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 27px; }
  .admin-toolbar, .list-toolbar { align-items: flex-start; flex-direction: column; }
  .admin-toolbar h1 { font-size: 24px; }
  .admin-tabs { padding: 0 5px; }
  .admin-tabs a { padding: 10px; font-size: 11.5px; }
  .filter-form { flex-wrap: wrap; }
  .form-panel { padding: 21px; }
  .question-card { padding: 17px; }
}
@media (max-width: 440px) {
  .hero-actions .btn, .form-actions .btn { width: 100%; }
  .hero-meta span { padding-inline: 9px; }
  .hero-meta span:first-child { padding-right: 0; }
  .banner { padding: 24px; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 14px; }
  .admin-tabs { padding: 2px 5px; }
  .admin-tabs a { padding: 9px 8px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
