/* Aram & Arivu portal. Palette comes from Tamil festival colour: peacock ink, turmeric, kumkum, leaf. */
:root {
  --ink: #0E2A47;
  --ink-2: #1B3F66;
  --ink-soft: #CFDCEB;
  --paper: #F3F5F7;
  --card: #FFFFFF;
  --text: #14202E;
  --muted: #55657A;
  --line: #D9E0E8;
  --turmeric: #F4B21C;
  --kumkum: #C8312B;
  --leaf: #1F7A5A;
  --teal: #138A8A;
  --magenta: #B5367A;
  --violet: #6A4C93;
  --orange: #E07A1F;
  --blue: #2F6DB5;
  --radius: 14px;
  --display: 'Bricolage Grotesque', 'Anek Tamil', system-ui, sans-serif;
  --body: 'Anek Latin', 'Anek Tamil', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 1.0625rem/1.55 var(--body); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0 0 1em; }
a { color: var(--ink-2); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: 0 1.4rem; border: 2px solid var(--ink); background: var(--ink); color: #fff; border-radius: 999px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, transform .15s; }
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn.alt { background: transparent; color: var(--ink); }
.btn.alt:hover { background: var(--ink); color: #fff; }
.btn.gold { background: var(--turmeric); border-color: var(--turmeric); color: #2A1B00; }
.btn.gold:hover { background: #FFC83D; border-color: #FFC83D; }
.btn.sm { min-height: 38px; padding: 0 1rem; font-size: .95rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem clamp(1rem, 4vw, 2.5rem); background: var(--ink); color: #fff; }
.bar .mark { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; font: 700 1.2rem var(--display); }
.bar .mark svg { width: 38px; height: 38px; }
.bar nav { display: flex; align-items: center; gap: 1rem; font-size: .95rem; }
.bar nav a { color: #fff; }
.bar .who { color: var(--ink-soft); }
.bar .btn { border-color: rgba(255,255,255,.55); background: transparent; color: #fff; }
.bar .btn:hover { background: #fff; color: var(--ink); }

/* ---------- landing ---------- */
.landing { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.landing .stage { background: var(--ink); color: #fff; padding: clamp(2rem, 6vw, 5rem); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; position: relative; overflow: hidden; }
.landing .stage .tamil { font: 800 clamp(3.2rem, 9vw, 7.2rem)/1 var(--display); letter-spacing: -0.02em; margin: 0; }
.landing .stage .tamil span { color: var(--turmeric); }
.landing .stage .en { font: 600 1.35rem var(--display); margin: .9rem 0 0; color: var(--ink-soft); }
.landing .stage .pitch { position: relative; z-index: 1; max-width: 27rem; color: #fff; font-size: 1.15rem; margin: 1.6rem 0 0; }
.landing .stage .kolam-wrap { position: absolute; right: -24%; bottom: -26%; width: min(86%, 600px); opacity: .95; pointer-events: none; }
.landing .stage .legend { position: relative; z-index: 1; max-width: 26rem; font-size: .95rem; color: var(--ink-soft); }
.landing .doors { padding: clamp(2rem, 6vw, 5rem); display: flex; flex-direction: column; justify-content: center; gap: 2.4rem; }
.door { border-left: 6px solid var(--turmeric); padding-left: 1.4rem; }
.door.stu { border-color: var(--teal); }
.door h2 { font-size: 1.6rem; margin-bottom: .5rem; }
.door p { color: var(--muted); max-width: 30rem; }
.notice { padding: .8rem 1rem; border-radius: 10px; background: #FDECEA; color: #7A1A16; border: 1px solid #F3B7B2; margin-bottom: 1rem; }
.notice.info { background: #EAF2FB; color: #1B3F66; border-color: #B9D0EA; }
.devrow { font-size: .9rem; color: var(--muted); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .15rem .7rem; border-radius: 999px; font-size: .88rem; font-weight: 600; white-space: nowrap; background: #E8EDF3; color: var(--ink); }
.pill::before { content: ''; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.pill.waiting { background: #FFF1CC; color: #7A5200; }
.pill.progress { background: #D6F0F0; color: #0B5C5C; }
.pill.submitted { background: #DCE8F7; color: #1D4C85; }
.pill.review { background: #E8E0F3; color: #4B3370; }
.pill.approved { background: #D5EFE4; color: #135A41; }
.pill.waitlisted { background: #FDE6CF; color: #8A4A0D; }
.pill.declined { background: #F7D9D7; color: #8A1F1A; }

/* ---------- employee dashboard ---------- */
.shell { max-width: 1180px; margin: 0 auto; padding: clamp(1.2rem, 4vw, 2.5rem); }
.dash { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.panel { background: var(--card); border-radius: var(--radius); padding: 1.6rem; border: 1px solid var(--line); }
.panel.tint { border-top: 6px solid var(--turmeric); }
.panel h2 { font-size: 1.5rem; margin-bottom: .4rem; }
.panel .sub { color: var(--muted); margin-bottom: 1.2rem; }
.linkbox { margin-top: 1.2rem; padding: 1rem; border-radius: 12px; background: #EAF6F0; border: 1px solid #A9D8C3; }
.linkbox code { display: block; word-break: break-all; font: 500 .95rem ui-monospace, Consolas, monospace; margin: .4rem 0 .8rem; }
.refs { list-style: none; margin: 0; padding: 0; }
.refs li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.refs li:last-child { border-bottom: 0; }
.refs .nm { font-weight: 700; }
.refs .meta { color: var(--muted); font-size: .92rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty svg { width: 120px; margin: 0 auto 1rem; display: block; }

/* ---------- form fields (shared) ---------- */
.field { margin: 0 0 1.5rem; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 600; margin-bottom: .35rem; padding: 0; }
.field .req { color: var(--kumkum); margin-left: .15rem; }
.field .hint { color: var(--muted); font-size: .95rem; margin: -.15rem 0 .5rem; }
.field .err { color: #A3221C; font-size: .95rem; margin-top: .35rem; font-weight: 600; }
.field.bad input[type=text], .field.bad input[type=date], .field.bad select, .field.bad textarea, .field.bad .drop { border-color: var(--kumkum); }
input[type=text], input[type=date], select, textarea { width: 100%; min-height: 48px; padding: .6rem .85rem; background: #fff; border: 2px solid #B5C2D1; border-radius: 10px; }
textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
textarea.big { min-height: 16rem; }
input:hover, textarea:hover, select:hover { border-color: var(--ink-2); }
.counter { font-size: .92rem; color: var(--muted); margin-top: .3rem; }
.counter.ok { color: var(--leaf); font-weight: 600; }
.opts { display: grid; gap: .5rem; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; gap: .75rem; min-height: 48px; padding: .5rem .9rem; border: 2px solid #B5C2D1; border-radius: 10px; background: #fff; transition: border-color .12s, background .12s; }
.opt span::before { content: ''; flex: none; width: 1.2rem; height: 1.2rem; border: 2px solid #8496AB; border-radius: 50%; background: #fff; }
.opt.multi span::before, .opt.consent span::before { border-radius: 5px; }
.opt input:hover + span { border-color: var(--ink-2); }
.opt input:checked + span { border-color: var(--sec, var(--ink)); background: color-mix(in srgb, var(--sec, var(--ink)) 10%, #fff); font-weight: 600; }
.opt input:checked + span::before { background: var(--sec, var(--ink)); border-color: var(--sec, var(--ink)); box-shadow: inset 0 0 0 3px #fff; }
.opt.multi input:checked + span::before, .opt.consent input:checked + span::before { box-shadow: inset 0 0 0 2px #fff; }
.opt input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.opts.inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------- apply (student) ---------- */
.apply { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--ink); color: #fff; padding: 1.6rem 1.4rem 2rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1.2rem; }
.rail .brand { font: 700 1.15rem var(--display); }
.rail .brand small { display: block; font: 400 .85rem var(--body); color: var(--ink-soft); }
.rail .kolam-box { width: 100%; max-width: 230px; margin: 0 auto; }
.stamp { border: 2px dashed rgba(255,255,255,.55); border-radius: 12px; padding: .8rem .95rem; font-size: .93rem; color: #fff; }
.stamp b { display: block; font: 700 1.05rem var(--display); color: var(--turmeric); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.steps button { display: grid; grid-template-columns: 1.35rem 1fr; gap: .7rem; align-items: center; width: 100%; text-align: left; background: none; border: 0; color: var(--ink-soft); padding: .45rem .4rem; border-radius: 8px; cursor: pointer; }
.steps button:hover { background: rgba(255,255,255,.08); color: #fff; }
.steps .dot { width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 2px solid var(--c); background: transparent; display: grid; place-items: center; font-size: .7rem; color: #fff; }
.steps .done .dot { background: var(--c); }
.steps .done .dot::after { content: '✓'; }
.steps .cur { color: #fff; font-weight: 700; background: rgba(255,255,255,.12); }
.main { padding: clamp(1.2rem, 4vw, 3.5rem); display: flex; flex-direction: column; align-items: flex-start; }
.main .sheet { width: 100%; max-width: 700px; }
.sec-head { border-top: 8px solid var(--sec); padding-top: 1.1rem; margin-bottom: 1.8rem; }
.sec-head h1 { font-size: clamp(2rem, 5vw, 3rem); }
.sec-head p { color: var(--muted); margin: .7rem 0 0; max-width: 38rem; }
.nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.saved { color: var(--muted); font-size: .9rem; min-height: 1.4rem; margin-top: 1rem; }
.mobile-top { display: none; }
.drop { border: 2px dashed #8EA0B5; border-radius: 12px; background: #fff; padding: .9rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.drop.has { border-style: solid; border-color: var(--leaf); background: #F0F9F4; }
.drop .fn { font-weight: 600; word-break: break-all; }
.drop .sz { color: var(--muted); font-size: .9rem; }
.referral-card { background: color-mix(in srgb, var(--turmeric) 22%, #fff); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1.8rem; border-left: 6px solid var(--turmeric); }
.referral-card b { font-family: var(--display); }
.done-screen { max-width: 620px; }
.done-screen .code { display: inline-block; font: 700 2rem ui-monospace, Consolas, monospace; letter-spacing: .06em; background: var(--ink); color: var(--turmeric); padding: .4rem 1rem; border-radius: 10px; margin: .6rem 0 1.2rem; }
.done-screen .kolam-big { width: min(320px, 70vw); margin-bottom: 1rem; }

/* ---------- admin ---------- */
.stats { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #E3E9F0; margin: .8rem 0 1rem; }
.stats i { display: block; height: 100%; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.chip { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: 0 .9rem; border-radius: 999px; border: 2px solid #B5C2D1; background: #fff; cursor: pointer; font-weight: 600; font-size: .95rem; }
.chip b { font-family: var(--display); }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tools { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.tools input[type=search] { flex: 1 1 240px; min-height: 44px; padding: .5rem .9rem; border: 2px solid #B5C2D1; border-radius: 999px; }
.tablewrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
th, td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 700; background: #F7F9FB; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #F3F8FD; }
tbody tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: .88rem; display: block; }
.flagn { display: inline-block; min-width: 1.6rem; text-align: center; padding: .05rem .45rem; border-radius: 999px; background: #F7D9D7; color: #8A1F1A; font-weight: 700; }
.flagn.zero { background: #E8EDF3; color: var(--muted); font-weight: 600; }
.drawer-back { position: fixed; inset: 0; background: rgba(14,42,71,.45); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--paper); z-index: 21; overflow-y: auto; padding: 1.4rem clamp(1rem, 3vw, 2rem) 3rem; box-shadow: -12px 0 40px rgba(0,0,0,.25); }
.drawer h2 { font-size: 1.9rem; }
.drawer .close { float: right; }
.dsec { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--c, var(--ink)); border-radius: 10px; padding: 1rem 1.2rem; margin: 1rem 0; }
.dsec h3 { font-size: 1.15rem; margin-bottom: .6rem; }
.dsec dl { margin: 0; display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: .4rem 1rem; font-size: .96rem; }
.dsec dt { color: var(--muted); }
.dsec dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.flags { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .35rem; }
.flags li { background: #FDECEA; border: 1px solid #F3B7B2; color: #7A1A16; padding: .4rem .8rem; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.flags li.none { background: #EAF6F0; border-color: #A9D8C3; color: #135A41; }
.decide { display: grid; gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; }
.hist { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.hist li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.hist small { color: var(--muted); display: block; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.3); }

/* ---------- kolam ---------- */
.kolam .petal { stroke-width: 2.2; transition: fill-opacity .5s ease, stroke-width .2s; }
.kolam .petal.cur { stroke-width: 4; }
.kolam .loop { fill: none; stroke: currentColor; stroke-width: 1.6; opacity: .5; }
.kolam .pulli { fill: currentColor; }
.kolam.draw .loop { stroke-dasharray: 1; stroke-dashoffset: 1; animation: kdraw 2.6s .2s cubic-bezier(.5,0,.2,1) forwards; }
.kolam.draw .petal { animation: kfill .8s ease backwards; animation-delay: calc(var(--i) * 140ms + 1.2s); }
@keyframes kdraw { to { stroke-dashoffset: 0; } }
@keyframes kfill { from { fill-opacity: 0; stroke-opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .landing { grid-template-columns: 1fr; }
  .landing .stage { min-height: 70vh; }
  .dash { grid-template-columns: 1fr; }
  .apply { grid-template-columns: 1fr; }
  .rail { display: none; }
  .mobile-top { display: flex; align-items: center; gap: 1rem; background: var(--ink); color: #fff; padding: .8rem 1rem; position: sticky; top: 0; z-index: 5; }
  .mobile-top .kolam-box { width: 54px; flex: none; }
  .mobile-top b { display: block; font: 700 1.05rem var(--display); }
  .mobile-top small { color: var(--ink-soft); }
  .dsec dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .kolam.draw .loop { stroke-dashoffset: 0; }
}
