/* ==========================================================================
   Mera Adda - design system
   ==========================================================================

   Responsive from 320px to wide desktop. Mobile-first: the base rules are the
   phone layout, and everything above 640px / 900px / 1100px is progressive.

   The palette is pink -> magenta -> violet, used as an ACCENT. Backgrounds
   stay neutral. A UI drenched in gradient reads as a dating app, and this is a
   social network that happens to contain a private matching feature.
   ========================================================================== */

:root {
    --pink: #FF3D9A;
    --magenta: #C026D3;
    --violet: #6D28D9;

    --gradient: linear-gradient(100deg, #FF3D9A 0%, #C026D3 55%, #6D28D9 100%);
    --gradient-soft: linear-gradient(135deg, rgba(255, 61, 154, .10), rgba(109, 40, 217, .10));

    --ink: #101018;
    --ink-2: #3d3d4d;
    --ink-3: #6b6b80;
    --ink-4: #9b9bb0;

    --bg: #ffffff;
    --bg-2: #f8f8fc;
    --bg-3: #eeeef5;
    --line: #e6e6f0;

    --danger: #e5484d;
    --success: #22a06b;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --radius-full: 999px;

    --shadow-sm: 0 1px 3px rgba(16, 16, 24, .06);
    --shadow: 0 6px 24px rgba(16, 16, 24, .08);
    --shadow-lg: 0 18px 50px rgba(16, 16, 24, .13);
    --shadow-brand: 0 10px 30px rgba(192, 38, 211, .28);

    --header-h: 56px;
    --tabbar-h: 58px;
    --sidebar-w: 232px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Devanagari", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #f4f4f8;
        --ink-2: #cbcbda;
        --ink-3: #9b9bb0;
        --ink-4: #6b6b80;

        --bg: #0d0d13;
        --bg-2: #15151d;
        --bg-3: #1f1f2b;
        --line: #282836;

        --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
        --shadow: 0 6px 24px rgba(0, 0, 0, .5);
        --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
    }
}

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

/*
 * The HTML `hidden` attribute, made to actually work.
 *
 * Browsers hide it with a UA rule of `[hidden] { display: none }`, but ANY
 * author rule that sets display beats the UA stylesheet regardless of
 * specificity. So `.thing { display: flex }` on an element marked `hidden`
 * leaves it fully visible, and every `el.hidden = true` in the JS silently
 * does nothing.
 *
 * That shipped: the incoming-call banner was permanently on screen as an empty
 * shell, and its dismiss button appeared broken because hiding it was a no-op.
 *
 * !important because the whole point is to outrank a component's own display
 * rule.
 */
[hidden] { display: none !important; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    /* Nothing may cause a sideways scroll on a phone. */
    overflow-x: hidden;
}

img, svg, video { max-width: 100%; display: block; }

a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.025em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 7vw, 40px); font-weight: 800; }
h2 { font-size: clamp(22px, 4.5vw, 30px); font-weight: 750; }
h3 { font-size: 17px; font-weight: 650; }

p { margin: 0 0 1em; }

:focus-visible {
    outline: 2px solid var(--violet);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.wrap { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 18px; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

@media (min-width: 768px) { .container { padding: 0 32px; } }

.center { text-align: center; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Brand
   -------------------------------------------------------------------------- */

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img, .brand svg { width: 34px; height: 34px; border-radius: 10px; }

/* "Mera" solid, "Adda" gradient - the wordmark from the logo, set in live text
   so it stays crisp at any zoom and needs no font file. */
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.035em; white-space: nowrap; }
.brand-name .g { background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--magenta); }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: var(--magenta);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    padding: 13px 22px;
    font-family: inherit; font-size: 15px; font-weight: 650;
    color: #fff;
    background: var(--gradient);
    border: none; border-radius: var(--radius-full);
    cursor: pointer; text-decoration: none;
    transition: transform .12s ease, box-shadow .18s ease, opacity .15s;
    box-shadow: var(--shadow-brand);
}

.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 14px 34px rgba(192, 38, 211, .34); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-loading { opacity: .55; cursor: not-allowed; pointer-events: none; box-shadow: none; }

.btn-secondary { background: var(--bg-3); color: var(--ink); box-shadow: none; }
.btn-secondary:hover { box-shadow: none; background: var(--line); }

.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn-outline:hover { box-shadow: none; border-color: var(--ink-4); }

.btn-ghost { background: transparent; color: var(--ink); box-shadow: none; font-weight: 600; }
.btn-ghost:hover { box-shadow: none; background: var(--bg-2); }

.btn-danger { background: var(--danger); box-shadow: none; }

.btn-sm { width: auto; padding: 9px 18px; font-size: 13.5px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-inline { width: auto; }

.btn-link {
    background: none; border: none; color: var(--violet);
    font: inherit; font-weight: 650; cursor: pointer; padding: 0; width: auto;
}

/* --------------------------------------------------------------------------
   Cards, forms, alerts
   -------------------------------------------------------------------------- */

.card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) { .card { padding: 30px; } }

.field { margin-bottom: 15px; }

.field label {
    display: block; font-size: 13px; font-weight: 650;
    color: var(--ink-2); margin-bottom: 6px;
}

.input,
input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="date"], input[type="search"],
select, textarea {
    width: 100%;
    padding: 12px 15px;
    font-family: inherit;
    /* 16px minimum, or iOS Safari zooms the page in on focus and never back. */
    font-size: 16px;
    color: var(--ink);
    background: var(--bg-2);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color .15s, background .15s;
}

input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--violet); background: var(--bg);
}

textarea { resize: vertical; min-height: 92px; line-height: 1.5; }

.field-hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 5px; }
input[aria-invalid="true"] { border-color: var(--danger); }

.alert {
    padding: 12px 15px; border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 14px; border: 1px solid transparent;
}
.alert-error   { background: rgba(229, 72, 77, .09);  border-color: rgba(229, 72, 77, .25);  color: #b8353a; }
.alert-success { background: rgba(34, 160, 107, .09); border-color: rgba(34, 160, 107, .25); color: #1a7a51; }
.alert-info    { background: rgba(109, 40, 217, .07); border-color: rgba(109, 40, 217, .2);  color: var(--violet); }

@media (prefers-color-scheme: dark) {
    .alert-error { color: #ff8a8d; }
    .alert-success { color: #6ee7a8; }
    .alert-info { color: #c4a8ff; }
}

/* --------------------------------------------------------------------------
   OTP input
   -------------------------------------------------------------------------- */

.otp-row { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 6px; }
.otp-box {
    flex: 1 1 0; min-width: 0; height: 56px;
    text-align: center; font-size: 22px; font-weight: 700; padding: 0;
}

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */

.auth-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg-2); }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 0 48px; }
.auth-card { width: 100%; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1 { font-size: clamp(24px, 6vw, 30px); margin-bottom: 6px; }
.auth-head p { color: var(--ink-3); font-size: 14.5px; margin: 0; }
.auth-foot { text-align: center; font-size: 14px; color: var(--ink-3); margin-top: 20px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-4); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* --------------------------------------------------------------------------
   Public site header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky; top: 0; z-index: 60;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}

@supports not (background: color-mix(in srgb, red 50%, transparent)) {
    .site-header { background: var(--bg); }
}

.site-header.is-stuck { border-bottom-color: var(--line); }

.site-header-inner {
    max-width: 1180px; margin: 0 auto; padding: 14px 20px;
    display: flex; align-items: center; gap: 16px;
}

@media (min-width: 768px) { .site-header-inner { padding: 16px 32px; } }

.site-nav { display: none; margin-left: auto; align-items: center; gap: 30px; }
.site-nav a { color: var(--ink-2); font-size: 14.5px; font-weight: 550; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }

.site-cta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.site-cta .login-link { font-size: 14.5px; font-weight: 650; color: var(--ink); }

/* The nav collapses on phones; the two buttons always stay reachable. */
@media (min-width: 900px) {
    .site-nav { display: flex; }
    .site-cta { margin-left: 28px; }
}

@media (max-width: 460px) {
    .site-cta .login-link { display: none; }
    .brand-name { font-size: 18px; }
}

/* --------------------------------------------------------------------------
   Public site footer
   -------------------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 40px 0 44px; margin-top: 60px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

@media (min-width: 768px) {
    .footer-inner { padding: 0 32px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
}

.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 18px 0; padding: 0; list-style: none; }
.footer-links a { color: var(--ink-2); font-size: 14px; }
.footer-legal { font-size: 12.5px; color: var(--ink-3); line-height: 1.75; }

/* --------------------------------------------------------------------------
   Long-form / legal
   -------------------------------------------------------------------------- */

.prose { max-width: 760px; margin: 0 auto; padding: 34px 20px 20px; }
.prose h1 { font-size: clamp(26px, 5vw, 34px); margin-bottom: 6px; }
.prose h2 { margin-top: 34px; font-size: 19px; }
.prose h3 { margin-top: 24px; font-size: 15.5px; }
.prose p, .prose li { color: var(--ink-2); font-size: 15px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 7px; }

.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 18px 0; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--bg-2); font-weight: 650; }

/* A wide table scrolls inside its own box - the page body never scrolls
   sideways, which on a phone is the difference between usable and broken. */
.prose > table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
@media (min-width: 700px) { .prose > table { display: table; white-space: normal; } }

.updated { font-size: 13px; color: var(--ink-3); padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --------------------------------------------------------------------------
   Spinner
   -------------------------------------------------------------------------- */

.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
    border-radius: 50%; animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

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

/* Spam-folder hint on the verification screens. New sending domains get
   filtered, and a student who thinks the mail never came just leaves. */
.spam-hint {
    margin: 14px auto 0;
    max-width: 380px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--ink-3);
}
.spam-hint strong { color: var(--ink); font-weight: 650; }
