/* =============================================================================
   DRONA BOOKS PORTAL — PUBLIC STYLES
   File    : assets/css/site.css
   Version : 1.0.0
   Date    : 2026-08-24
   =============================================================================

   Mobile-first, hand-written, no framework. About 12KB — which matters, because
   most trainers open this from a WhatsApp link on a low-end Android phone over
   patchy mobile data. A 200KB CSS framework would be most of the page weight
   and would buy nothing this file does not already do.

   KANNADA TYPOGRAPHY
   ------------------
   Kannada needs more vertical room than Latin: the script stacks vowel signs
   above and below the baseline, and conjunct consonants hang below it. With a
   normal 1.4 line-height the marks of one line collide with the next. Every
   line-height here is 1.6 or more, and Kannada text gets 1.75.

   TOUCH TARGETS
   -------------
   Every tappable thing is at least 44px tall. That is not a style choice — it
   is the minimum a thumb can hit reliably on a phone being used one-handed,
   which is how this form will actually be filled in.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --green:        #1a5f3f;
    --green-dark:   #12452e;
    --green-light:  #e8f3ed;
    --amber:        #b45309;
    --amber-light:  #fef3c7;
    --red:          #b91c1c;
    --red-light:    #fee2e2;
    --blue:         #1d4ed8;
    --blue-light:   #dbeafe;

    --ink:          #14181f;
    --ink-soft:     #4b5563;
    --ink-faint:    #6b7280;
    --line:         #e2e5ea;
    --bg:           #f7f8fa;
    --card:         #ffffff;

    --radius:       10px;
    --radius-sm:    6px;
    --shadow:       0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
    --shadow-lg:    0 4px 12px rgba(16, 24, 40, .10);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
    --font-kn: "Noto Sans Kannada", "Tunga", "Nirmala UI", var(--font);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;          /* never below 16px: iOS zooms the page on focus otherwise */
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

html[lang^="kn"] body,
.kn {
    font-family: var(--font-kn);
    line-height: 1.75;        /* room for stacked vowel signs and conjuncts */
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 650; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

html[lang^="kn"] h1, html[lang^="kn"] h2, html[lang^="kn"] h3 { line-height: 1.5; }

p { margin: 0 0 1em; }
a { color: var(--green); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1100px; }

.section { padding: 28px 0; }
.section-tight { padding: 16px 0; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--ink-faint); }
.small { font-size: .875rem; }
.tiny  { font-size: .8rem; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.site-header {
    background: var(--green);
    color: #fff;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 40;
}
.site-header a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.05rem; letter-spacing: .2px; }
.brand-sub { font-size: .78rem; opacity: .85; font-weight: 400; }

.lang-toggle {
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: .85rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,.08);
}

/* ---------- Banner ---------- */
.banner {
    padding: 12px 16px;
    text-align: center;
    font-weight: 600;
    font-size: .95rem;
    border-bottom: 1px solid var(--line);
}
.banner-open      { background: var(--green-light); color: var(--green-dark); }
.banner-closing   { background: var(--amber-light); color: var(--amber); }
.banner-closed    { background: var(--red-light);   color: var(--red); }
.banner-info      { background: var(--blue-light);  color: var(--blue); }
.banner .countdown { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;               /* thumb-sized */
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .12s ease, transform .06s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }

.btn-primary   { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-whatsapp  { background: #25d366; color: #fff; }
.btn-block     { width: 100%; }
.btn-lg        { min-height: 56px; font-size: 1.05rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: 6px;
}
.field .hint { font-size: .82rem; color: var(--ink-faint); margin-top: 5px; }

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="number"],
.field input[type="password"],
.field select,
.field textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 13px;
    font: inherit;
    font-size: 16px;            /* prevents the iOS zoom-on-focus */
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    appearance: none;
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.6; }

.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(26, 95, 63, .13);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--red); }

.field .error { color: var(--red); font-size: .85rem; margin-top: 5px; font-weight: 500; }

.required::after { content: " *"; color: var(--red); }

/* The honeypot — visually gone, but still a real field a bot will fill. */
.hp {
    position: absolute !important;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ---------- Live price summary ---------- */
.summary {
    background: var(--green-light);
    border: 1px solid #cfe3d8;
    border-radius: var(--radius);
    padding: 16px;
}
.summary-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    font-size: .95rem;
}
.summary-line.total {
    border-top: 1.5px solid #cfe3d8;
    margin-top: 8px;
    padding-top: 11px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--green-dark);
}
.summary-line .amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-line.discount .amount { color: var(--green); }

/* ---------- Price tiers ---------- */
.tiers { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tiers th, .tiers td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.tiers th { font-weight: 650; color: var(--ink-soft); font-size: .85rem; }
.tiers td:last-child, .tiers th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tiers tr.active { background: var(--green-light); font-weight: 650; }

/* ---------- Booking ID display ---------- */
.booking-id {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--green-dark);
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

/* ---------- Slot buttons ---------- */
.slots { display: grid; gap: 12px; }
.slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 62px;
    padding: 14px 18px;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.slot:hover { border-color: var(--green); }
.slot .slot-label  { font-weight: 650; }
.slot .slot-amount { font-size: 1.2rem; font-weight: 700; color: var(--green-dark); font-variant-numeric: tabular-nums; }
.slot.recommended  { border-color: var(--green); background: var(--green-light); }
.slot .slot-tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--green);
}

/* ---------- Status badges ---------- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 650;
    white-space: nowrap;
}
.badge-grey       { background: #eef0f3; color: #4b5563; }
.badge-amber      { background: var(--amber-light); color: var(--amber); }
.badge-blue       { background: var(--blue-light); color: var(--blue); }
.badge-green      { background: var(--green-light); color: var(--green-dark); }
.badge-green-dark { background: var(--green); color: #fff; }
.badge-teal       { background: #ccfbf1; color: #0f766e; }
.badge-red        { background: var(--red-light); color: var(--red); }
.badge-muted      { background: #f1f2f4; color: #9ca3af; }

/* ---------- Alerts ---------- */
.alert {
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: .94rem;
    border: 1px solid transparent;
}
.alert-success { background: var(--green-light); color: var(--green-dark); border-color: #cfe3d8; }
.alert-warning { background: var(--amber-light); color: var(--amber); border-color: #fcd9a0; }
.alert-error   { background: var(--red-light);   color: var(--red);   border-color: #f6b9b9; }
.alert-info    { background: var(--blue-light);  color: var(--blue);  border-color: #bfd3fb; }

/* ---------- Steps ---------- */
.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 13px; align-items: flex-start; }
.step-num {
    flex: 0 0 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
}
.step-body h3 { margin-bottom: 3px; font-size: 1rem; }
.step-body p  { margin: 0; font-size: .92rem; color: var(--ink-soft); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    position: relative;
    padding: 0 0 20px 28px;
    border-left: 2px solid var(--line);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: "";
    position: absolute;
    left: -7px; top: 3px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--line);
}
.timeline li.done { border-left-color: var(--green); }
.timeline li.done::before { background: var(--green); border-color: var(--green); }
.timeline .when { font-size: .82rem; color: var(--ink-faint); }

/* ---------- Book hero ---------- */
.book-hero { display: grid; gap: 18px; }
.book-cover {
    width: 150px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
}
.price-headline {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--green-dark);
    font-variant-numeric: tabular-nums;
}
.price-mrp { text-decoration: line-through; color: var(--ink-faint); font-size: 1rem; font-weight: 400; }

/* ---------- Header and form fit ---------- */
/* The tagline wraps to two lines on a narrow phone, which makes the header
   taller than the first thing anyone came to read. One line, ellipsis if it
   does not fit — the full text is still in the page for screen readers. */
.brand-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (min-width: 480px) {
    .brand-sub { white-space: normal; }
}

/* Two selects side by side inside the ~420px desktop form column leaves the
   Kannada placeholders clipped mid-word. The pair only fits two-up in the
   full-width phone layout, so stack it in the aside. */
@media (min-width: 1024px) {
    .landing-aside .field-pair { grid-template-columns: 1fr; }
}

/* A <select> clips its text with no ellipsis and no warning. Give the value
   room by allowing the control to shrink to its container rather than to its
   longest option. */
select { max-width: 100%; text-overflow: ellipsis; }

/* ---------- Other titles (the shop window) ---------- */
/* auto-fill rather than a fixed column count, so the grid adapts as the
   catalogue grows without needing a new breakpoint per title. */
.title-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin: 14px 0 12px;
}
.title-card { min-width: 0; }
.title-cover {
    width: 100%;
    max-width: 140px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    background: var(--green-light);
}
.title-cover-empty {
    display: grid;
    place-items: center;
    color: var(--green);
    font-size: 2rem;
    font-weight: 700;
}
.title-body h3 { font-size: .98rem; margin: 8px 0 2px; }
.title-body p  { margin: 0 0 2px; }

/* ---------- Brand mark ---------- */
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }

/* The mark is constrained THREE ways on purpose.
   width fixes its size, max-height stops it ever driving the header's height,
   and flex-shrink:0 keeps it from being squashed by a long organisation name.
   The SVG file also carries its own width/height attributes, so even with this
   stylesheet missing entirely the logo stays small instead of filling the
   page. */
.brand-mark {
    flex: 0 0 auto;
    width: 34px;
    max-height: 40px;
    color: #fff;
    overflow: hidden;
}
.brand-mark svg {
    width: 100%;
    height: auto;
    max-height: 40px;
    display: block;
}
.brand-text { min-width: 0; }

@media (min-width: 1024px) {
    .brand-mark { width: 42px; max-height: 48px; }
    .brand-mark svg { max-height: 48px; }
}

/* ---------- Quantity by edition ---------- */
/* Two boxes side by side even on the narrowest phone: they are short numeric
   fields, and stacking them makes the pair read as two unrelated questions
   rather than one "how many of each". */
.qty-editions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qty-edition label {
    display: block;
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 4px;
}
.qty-edition input { width: 100%; }
.qty-total {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--green-light);
    border-radius: var(--radius-sm);
    font-size: .95rem;
}
.qty-total strong { font-variant-numeric: tabular-nums; }

/* ---------- Testimonials ---------- */
.testimonial {
    border-left: 3px solid var(--green);
    padding: 4px 0 4px 14px;
    margin-bottom: 16px;
}
.testimonial p { margin: 0 0 5px; font-style: italic; }
.testimonial cite { font-style: normal; font-size: .85rem; color: var(--ink-faint); }

/* ---------- FAQ ---------- */
details.faq {
    border-bottom: 1px solid var(--line);
    padding: 13px 0;
}
details.faq summary {
    font-weight: 620;
    cursor: pointer;
    list-style: none;
    min-height: 30px;
    padding-right: 26px;
    position: relative;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
    content: "+";
    position: absolute;
    right: 4px; top: 0;
    font-size: 1.3rem;
    color: var(--green);
    line-height: 1;
}
details.faq[open] summary::after { content: "−"; }
details.faq .faq-body { padding-top: 8px; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Prose (policy pages, admin-authored HTML) ---------- */
.prose h2 { margin-top: 1.5em; }
.prose h3 { margin-top: 1.3em; font-size: 1rem; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }

/* ---------- Footer ---------- */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 26px 0;
    margin-top: 36px;
    font-size: .88rem;
    color: var(--ink-soft);
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 16px;
}
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--green); text-decoration: underline; }

/* ---------- QR / UPI ---------- */
.upi-box { text-align: center; }
.upi-id {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 1.05rem;
    background: #f1f2f4;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    word-break: break-all;
    user-select: all;
}
.upi-qr { max-width: 230px; margin: 16px auto; }

/* ---------- Spinner ---------- */
.spinner {
    display: inline-block;
    width: 17px; height: 17px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
    h1 { font-size: 1.9rem; }
    .card { padding: 24px; }
    .section { padding: 36px 0; }
    .slots { grid-template-columns: 1fr; }
    /* Only when a cover image actually exists. Without this guard the text
       block becomes the first grid item and gets squeezed into the 170px
       column — which is what every fresh install looked like. */
    .book-hero.has-cover { grid-template-columns: 170px 1fr; align-items: start; }
    .book-cover { margin: 0; }
    .field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
}

/* =============================================================================
   DESKTOP
   =============================================================================
   Everything above is the phone layout, and it is the one that matters most —
   nearly every trainer arrives from a WhatsApp link. But the admin works from a
   laptop, and a phone column stranded down the middle of a 1440px screen looks
   unfinished and reads badly: a paragraph 1200px wide runs to 170 characters a
   line, roughly twice the length the eye tracks comfortably.

   So: cap the measure, then use the extra width for something useful rather
   than stretching what is already fine.
   ========================================================================== */

/* Prose never gets wider than about 68 characters, whatever the container.
   `ch` is the width of "0" in the current font, so this tracks the font size
   instead of guessing in pixels. */
.prose p, .prose li, .card > p, .step-body p, .alert {
    max-width: 68ch;
}
.center .prose p, .center > p { margin-left: auto; margin-right: auto; }

@media (min-width: 1024px) {
    /* Two columns: the book on the left, the booking form on the right where
       it is visible without scrolling. On phones .landing-grid is just a plain
       block and this never applies. */
    .landing-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
        gap: 24px;
        align-items: start;
    }
    .wrap { max-width: 1120px; }

    /* The form follows you down the page instead of scrolling away.
       max-height + overflow keeps a long form usable on a short laptop screen
       rather than clipping its submit button off the bottom. */
    .landing-aside > .card {
        position: sticky;
        top: 16px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }

    h1 { font-size: 2.1rem; }
    h2 { font-size: 1.4rem; }
    .card { padding: 26px 24px; }
    .section { padding: 40px 0; }
}

@media (min-width: 1440px) {
    .wrap { max-width: 1200px; }
}

/* A sticky panel is wrong when the user has asked for less motion, and wrong
   on a short screen where it would cover the page. */
@media (prefers-reduced-motion: reduce) {
    .landing-aside > .card { position: static; max-height: none; }
}
@media (max-height: 700px) {
    .landing-aside > .card { position: static; max-height: none; }
}

/* ---------- Print (receipts, labels) ---------- */
@media print {
    .site-header, .site-footer, .banner, .btn, .no-print { display: none !important; }
    body { background: #fff; font-size: 12pt; }
    .card { border: none; box-shadow: none; padding: 0; }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
