/* eyz.in UI Redesign - Design System & Clean Layout */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;600;700&family=Noto+Sans+Gujarati:wght@400;600;700&family=Noto+Sans:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --ink: #0F172A;
  --muted: #475569;
  --line: #E2E8F0;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --primary: #12355B;
  --primary-hover: #0E2A48;
  --ok: #0F766E;
  --ok-bg: #ECFDF5;
  --note: #B45309;
  --note-bg: #FFFBEB;
  --err: #B91C1C;
  --err-bg: #FEF2F2;

  --font-main: 'Noto Sans', 'Noto Sans Devanagari', 'Noto Sans Gujarati', sans-serif;
  --req-cols: minmax(170px, 1.2fr) minmax(220px, 2fr) 104px 112px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  width: 100%;
  overflow-x: hidden;
}

/* Header (One row, 64px) */
header {
  height: 64px;
  background-color: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-wordmark {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* Language Segmented Control (36px tall) */
.lang-segmented {
  display: flex;
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  height: 44px;
  align-items: center;
}

.lang-segmented-btn {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.lang-segmented-btn.active {
  background-color: var(--card);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Container: Single Centred Column max-width 960px */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Cards */
.card-panel {
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  width: 100%;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.3;
}

.h1-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 8px;
}

/* Search Box & Category Tabs */
.search-input {
  width: 100%;
  height: 44px;
  font-size: 16px;
  font-family: inherit;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--card);
  color: var(--ink);
  margin-bottom: 16px;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 53, 91, 0.15);
}

.category-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Exam Chips: One row horizontal scroll */
.chips-scroll-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.exam-chip {
  flex: 0 0 auto;
  height: 40px;
  padding: 4px 14px;
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  transition: all 0.15s ease;
}

.exam-chip:hover {
  border-color: var(--primary);
  background-color: var(--bg);
}

.exam-chip.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.chip-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
}

.exam-chip.active .chip-title {
  color: #FFFFFF;
}

.chip-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.1;
}

.exam-chip.active .chip-sub {
  color: #E2E8F0;
}

/* Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
}

.status-pill.teal {
  background-color: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #99f6e4;
}

.status-pill.amber {
  background-color: var(--note-bg);
  color: var(--note);
  border: 1px solid #fde68a;
}

.status-pill.err {
  background-color: var(--err-bg);
  color: var(--err);
  border: 1px solid #fca5a5;
}

/* Notice Link & Meta */
.notice-meta {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.notice-meta a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

/* Requirements List */
.req-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--card);
}

.req-row {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.req-row:last-child {
  border-bottom: none;
}

.req-row-main {
  display: grid;
  grid-template-columns: var(--req-cols);
  align-items: center;
  column-gap: 12px;
  padding: 0 16px;
}

.req-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
}

.req-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}

.req-page {
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.req-toggle-btn {
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
}

.req-toggle-btn:hover {
  text-decoration: underline;
}

.req-quote-box {
  margin: 8px 16px 0 16px;
  padding: 8px 12px;
  background-color: var(--bg);
  border-left: 3px solid var(--primary);
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
}

.note-box-amber {
  background-color: var(--note-bg);
  border: 1px solid #fde68a;
  color: var(--note);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin: 8px 16px 0 16px;
}

/* Age Bands Sub-Rows & Notes */
.age-bands-wrap {
  margin: 8px 0 0 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
}

.age-band-row {
  margin: 0;
  padding: 8px 0;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background-color: #F8FAFC;
}

.age-band-row .req-label {
  padding-left: 16px;
}

.age-relaxation-note {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  padding: 8px 16px;
  background-color: #F8FAFC;
  border-top: 1px solid var(--line);
}

@media (max-width: 639px) {
  .req-row-main {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 4px;
    row-gap: 2px;
    align-items: center;
    padding: 0 16px;
  }

  .req-label {
    grid-column: 1 / -1;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
  }

  .req-val {
    grid-column: 1 / -1;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    text-align: left;
  }

  .req-page {
    grid-column: 1;
    font-size: 13px;
    color: var(--muted);
    text-align: left;
  }

  .req-page:has(+ .req-toggle-btn)::after {
    content: " · ";
    margin: 0 2px;
  }

  .req-toggle-btn {
    grid-column: 2;
    font-size: 13px;
    color: var(--muted);
    text-align: left;
  }

  .age-band-row .req-label {
    padding-left: 12px;
  }
}

/* Grey note under a value (e.g. no pixel size, reopened dates) */
.req-note {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}

/* Source of a value from a later notice: second line under the page number */
.req-src {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}
.req-src-dot { display: none; }

.status-pill.neutral {
  background-color: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}
.status-pill.pill-inline {
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 12px;
  vertical-align: middle;
}

/* Age relaxation sub-row: one sentence across label + value columns */
.age-relax-row .req-label { grid-column: 1 / 3; }
.age-relax-row .req-val { display: none; }

@media (max-width: 639px) {
  .req-src { display: inline; font-size: 13px; }
  .req-src-dot { display: inline; }
  .age-relax-row .req-label { grid-column: 1 / -1; }
}

/* Tools Section */
.tool-step-card {
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drop-zone-160 {
  height: 160px;
  width: 100%;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-align: center;
  padding: 16px;
  transition: all 0.15s ease;
}

.drop-zone-160.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.drop-zone-160:hover {
  border-color: var(--primary);
  background-color: #f1f5f9;
}

.drop-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.drop-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Buttons */
.btn-primary {
  height: 44px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  background-color: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-primary:disabled, .btn-secondary:disabled {
  background: transparent !important;
  border: 1px solid var(--line) !important;
  color: var(--muted) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.btn-secondary {
  height: 44px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  background-color: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background-color: var(--line);
}

/* Canvas & Overlays */
.preview-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

canvas.preview-canvas {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #FFFFFF;
  display: block;
}

.overlay-line {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 1px;
  border-top: 2px dashed var(--primary);
  pointer-events: none;
}

.status-box {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.status-box.ok {
  background-color: var(--ok-bg);
  border: 1px solid #99f6e4;
  color: var(--ok);
}

.status-box.err {
  background-color: var(--err-bg);
  border: 1px solid #fca5a5;
  color: var(--err);
}

/* Live capture tips list */
.live-capture-list {
  margin-left: 20px;
  font-size: 14px;
  color: var(--ink);
}

.live-capture-list li {
  margin-bottom: 6px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--card);
  border-radius: 10px;
  padding: 24px;
  max-width: 540px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.corrections-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

.corrections-table th, .corrections-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

.corrections-table th {
  background-color: var(--bg);
  font-weight: 700;
}

/* Footer */
footer {
  border-top: 1px solid var(--line);
  background-color: var(--card);
  padding: 32px 16px;
  margin-top: 48px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.footer-link-btn:hover {
  color: var(--primary-hover);
}

.footer-board-ack {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.footer-privacy {
  font-size: 13px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

/* Later official notices in the exam header */
.later-notices-line a { color: var(--primary); }

/* Avoid-rejection card */
.risks-sub { font-size: 13px; color: var(--muted); margin: -4px 0 12px 0; line-height: 1.5; }
.risk-row .req-label { grid-column: 1 / 3; color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1.5; }
.risk-row .req-val { display: none; }
.decl-box { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--bg); }
.decl-head { font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.decl-text { font-family: Georgia, 'Times New Roman', serif; font-size: 15px; line-height: 1.6; color: var(--ink);
  background: var(--card); border: 1px dashed var(--line); border-radius: 6px; padding: 10px 12px; user-select: all; }
.decl-note { font-size: 13px; color: var(--muted); margin-top: 8px; }
.decl-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* Resize tools */
.img-tool { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 12px; background: var(--card); }
.img-tool-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.img-tool-spec { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.img-tool-note { font-size: 12px; color: var(--muted); margin: 4px 0 10px 0; }
.img-tool-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.img-tool-pick { cursor: pointer; }
.img-tool-dl { text-decoration: none; }
.img-tool-out { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.img-tool-out.hidden { display: none; }
.img-tool-preview { max-width: 160px; max-height: 120px; border: 1px solid var(--line); background: #fff; }
.img-tool-result { font-size: 13px; font-weight: 600; color: var(--ok); }
@media (max-width: 639px) {
  .risk-row .req-label { grid-column: 1 / -1; }
}

/* ===== v1.1 table polish: clear lines, source pills, touch-sized buttons ===== */
.req-list { border-color: #CBD5E1; }
.req-row { border-bottom: 1px solid #CBD5E1; padding: 0; gap: 0; }
.req-row:last-child { border-bottom: none; }
.pg-pill { display: inline-block; background: #EEF2F7; color: #334155; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; line-height: 1.5; }
.req-src { display: inline-block; margin-top: 4px; background: #FEF3C7; color: #92400E; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: normal; }
.req-src-dot { display: none !important; }
.req-toggle-btn { border: 1px solid #94A3B8; border-radius: 6px; background: #fff; color: #1E3A5F; padding: 6px 10px; min-height: 32px; font-weight: 600; }
.req-toggle-btn:hover { background: #EEF2F7; text-decoration: none; }
.req-note { background: #F1F5F9; border-left: 3px solid #94A3B8; border-radius: 4px; padding: 6px 10px; margin-top: 6px; color: #475569; }
.req-quote-box { margin: 0 16px 12px 16px; }
@media (min-width: 640px) {
  .req-row-main { align-items: stretch; column-gap: 0; padding: 0; }
  .req-row-main > * { padding: 12px 14px; border-left: 1px solid #E2E8F0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
  .req-row-main > .req-label { border-left: none; background: #F8FAFC; padding-left: 16px; }
  .req-row-main > .req-toggle-placeholder { padding: 0; }
  .age-band-row .req-label { padding-left: 28px; }
}
@media (max-width: 639px) {
  .req-row-main { padding: 12px 16px; row-gap: 4px; }
  .req-label { font-size: 13px; }
  .req-val { font-size: 17px; }
  .req-page { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .req-page:has(+ .req-toggle-btn)::after { content: none; }
  .req-src { display: inline-block; margin-top: 0; }
  .req-toggle-btn { grid-column: 1 / -1; min-height: 40px; width: 100%; text-align: center; margin-top: 4px; }
  .req-quote-box { margin: 0 16px 12px 16px; }
}
/* v1.1b: wider source/button columns so the amber pill stays on one line */
:root { --req-cols: minmax(150px, 1.1fr) minmax(200px, 2fr) 200px 150px; }
.pg-pill, .req-src { border-radius: 12px; }
.req-toggle-btn { white-space: normal; }
/* v1.1c: button is a bordered chip, not a full-height cell */
@media (min-width: 640px) {
  .req-row-main > .req-toggle-btn { align-self: center; justify-self: start; display: inline-block; padding: 6px 12px; margin: 8px 14px; border: 1px solid #94A3B8; text-align: center; }
}
