/* ==========================================================================
   HEXA'S — IELTS Speaking Score
   Design tokens
   ========================================================================== */

:root {
    --ink:        #0E1726;
    --ink-2:      #17233A;
    --ink-3:      #22314D;

    --gold:       #C8A24A;
    --gold-lite:  #E4CE93;
    --gold-glow:  rgba(200, 162, 74, .18);

    --paper:      #FFFFFF;
    --bg:         #EFF1F5;
    --bg-2:       #F7F8FA;

    --text:       #172030;
    --muted:      #6C7789;
    --faint:      #9AA3B2;
    --line:       #E2E6ED;
    --line-soft:  #EDF0F4;

    --green:      #1B8F63;
    --green-bg:   #E8F6F0;
    --red:        #C93F3F;
    --red-bg:     #FCEDED;
    --amber:      #B5811E;
    --amber-bg:   #FDF4E3;

    --r-sm: 8px;
    --r:    12px;
    --r-lg: 18px;
    --r-xl: 24px;

    --sh-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --sh-2: 0 4px 8px rgba(16, 24, 40, .04), 0 12px 24px rgba(16, 24, 40, .07);
    --sh-3: 0 8px 16px rgba(16, 24, 40, .06), 0 24px 48px rgba(16, 24, 40, .12);

    --ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,
          'Noto Sans Bengali', 'Nirmala UI', sans-serif;
    --display: 'Playfair Display', 'Georgia', 'Times New Roman', serif;

    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */

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

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

body {
    margin: 0;
    font-family: var(--ui);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(900px 500px at 12% -8%, rgba(200, 162, 74, .10), transparent 60%),
        radial-gradient(800px 500px at 92% 0%, rgba(23, 35, 58, .10), transparent 55%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure { margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; }

::selection { background: var(--gold-glow); }

/* ==========================================================================
   Layout
   ========================================================================== */

.shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 16px 140px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(239, 241, 245, .82);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid rgba(226, 230, 237, .9);
}

.topbar__inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ==========================================================================
   Wordmark
   ========================================================================== */

.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; }

.mark__cap {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: linear-gradient(145deg, var(--ink-2), var(--ink));
    box-shadow: 0 2px 6px rgba(14, 23, 38, .28);
    flex: none;
}
.mark__cap svg { width: 17px; height: 17px; fill: var(--gold-lite); }

.mark__text { line-height: 1; }

.mark__name {
    font-weight: 800;
    font-size: 17px;
    letter-spacing: .11em;
    color: var(--ink);
}

.mark__branch {
    display: block;
    margin-top: 3px;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: .34em;
    color: var(--muted);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .15s var(--ease), box-shadow .2s var(--ease),
                background .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { box-shadow: var(--sh-1); border-color: #D3D9E2; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn--dark {
    background: linear-gradient(145deg, var(--ink-2), var(--ink));
    border-color: transparent;
    color: #fff;
}
.btn--dark:hover { box-shadow: 0 6px 18px rgba(14, 23, 38, .28); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: rgba(255, 255, 255, .7); color: var(--text); }

.btn--sm { padding: 7px 12px; font-size: 12.5px; }

.btn[disabled] { opacity: .55; pointer-events: none; }

.btn svg { width: 15px; height: 15px; flex: none; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    margin-top: 22px;
    padding: 28px 26px 30px;
    border-radius: var(--r-xl);
    background:
        radial-gradient(700px 300px at 88% -20%, rgba(200, 162, 74, .22), transparent 62%),
        linear-gradient(150deg, var(--ink-3) 0%, var(--ink) 62%);
    color: #fff;
    box-shadow: var(--sh-3);
    overflow: hidden;
}

/* gold hairline on top — gives the feel of the paper banner */
.hero::before {
    content: '';
    position: absolute; inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), var(--gold-lite), var(--gold), transparent);
    opacity: .85;
}

.hero__ribbon {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 999px;
    background: rgba(200, 162, 74, .14);
    border: 1px solid rgba(200, 162, 74, .34);
    color: var(--gold-lite);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
}
.hero__ribbon svg { width: 12px; height: 12px; fill: currentColor; }

.hero__title {
    margin-top: 15px;
    font-family: var(--display);
    font-size: clamp(27px, 6.4vw, 40px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.015em;
}

.hero__sub {
    margin-top: 9px;
    max-width: 46ch;
    font-size: 13.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .62);
}

/* ==========================================================================
   Card / section
   ========================================================================== */

.card {
    margin-top: 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1);
    overflow: hidden;
}

.card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 22px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, #FCFCFD, #F8F9FB);
}

.card__step {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    flex: none;
    border-radius: 8px;
    background: linear-gradient(145deg, var(--ink-3), var(--ink));
    color: var(--gold-lite);
    font-size: 12px;
    font-weight: 700;
}

.card__title { font-size: 14.5px; font-weight: 700; letter-spacing: -.005em; }
.card__hint  { margin-top: 1px; font-size: 12px; color: var(--muted); }

.card__body { padding: 20px 22px 22px; }

/* ==========================================================================
   Fields
   ========================================================================== */

.grid { display: grid; gap: 15px; }
.grid--2 { grid-template-columns: 1fr; }

@media (min-width: 620px) {
    .grid--2 { grid-template-columns: 1fr 1fr; }
    .grid--2 .field--wide { grid-column: 1 / -1; }
}

.field label,
.field .field__label {
    display: block;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}

.field__req { color: var(--gold); margin-left: 2px; }

.input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--bg-2);
    transition: border-color .18s var(--ease), background .18s var(--ease),
                box-shadow .18s var(--ease);
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #D3D9E2; }
.input:focus {
    outline: none;
    background: var(--paper);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

textarea.input { min-height: 76px; resize: vertical; line-height: 1.55; }

.input--error { border-color: var(--red); background: var(--red-bg); }

.field__error {
    display: none;
    margin-top: 5px;
    font-size: 12px;
    color: var(--red);
}
.field__error.is-on { display: block; }

/* ==========================================================================
   Scoring rows — the 4 rows of the paper table
   ========================================================================== */

.criterion { padding: 16px 0; border-top: 1px solid var(--line-soft); }
.criterion:first-child { padding-top: 2px; border-top: 0; }

.criterion__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 11px;
}

.criterion__name { font-size: 13.5px; font-weight: 600; }

.criterion__band {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--gold);
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.criterion__band.is-on { opacity: 1; transform: none; }

.levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

@media (min-width: 700px) {
    .levels { grid-template-columns: repeat(4, 1fr); }
}

.level {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
    padding: 10px 12px;
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    background: var(--bg-2);
    cursor: pointer;
    transition: border-color .18s var(--ease), background .18s var(--ease),
                box-shadow .2s var(--ease), transform .15s var(--ease);
}
.level:hover { border-color: var(--gold-lite); background: var(--paper); }
.level:active { transform: scale(.985); }

.level input { position: absolute; opacity: 0; pointer-events: none; }

.level__no {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--faint);
    transition: color .18s var(--ease);
}

.level__label {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}

.level__tick {
    position: absolute;
    top: 8px; right: 8px;
    width: 16px; height: 16px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0;
    transform: scale(.5);
    transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.level__tick svg { width: 9px; height: 9px; fill: #fff; }

.level input:checked ~ .level__tick { opacity: 1; transform: none; }

.level:has(input:checked) {
    border-color: var(--gold);
    background: linear-gradient(180deg, #FFFDF7, #FDF8ED);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.level:has(input:checked) .level__no { color: var(--gold); }

.level input:focus-visible ~ .level__tick { opacity: 1; transform: none; }
.level:has(input:focus-visible) { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }

/* ==========================================================================
   Suggestion presets
   ========================================================================== */

.sug { padding: 16px 0; border-top: 1px solid var(--line-soft); }
.sug:first-child { padding-top: 2px; border-top: 0; }

.sug__name {
    margin-bottom: 9px;
    font-size: 13.5px;
    font-weight: 600;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }

.chip {
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-2);
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    transition: all .16s var(--ease);
}
.chip:hover { border-color: var(--gold-lite); background: #FFFDF7; color: var(--text); }
.chip:active { transform: scale(.97); }
.chip.is-used {
    border-color: var(--gold);
    background: linear-gradient(180deg, #FFFDF7, #FBF3E2);
    color: var(--amber);
}
.chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ==========================================================================
   Score panel (sticky)
   ========================================================================== */

.scorebar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin: 0 -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(170%) blur(14px);
    -webkit-backdrop-filter: saturate(170%) blur(14px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 28px rgba(16, 24, 40, .08);
}

.scorebar__inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.scoredot {
    position: relative;
    width: 62px; height: 62px;
    flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--ink-3), var(--ink));
    box-shadow: 0 4px 14px rgba(14, 23, 38, .3), inset 0 0 0 1px rgba(200, 162, 74, .35);
}

.scoredot__val {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    color: var(--gold-lite);
    line-height: 1;
    transition: transform .3s var(--ease);
}
.scoredot__val.is-pop { transform: scale(1.16); }

.scoredot__cap {
    position: absolute;
    bottom: 9px;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: .16em;
    color: rgba(228, 206, 147, .6);
}

.scoremeta { flex: 1; min-width: 0; }

.scoremeta__label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.scoremeta__verdict {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scoremeta__edit {
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gold);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 520px) {
    .scoremeta__verdict { font-size: 12.5px; }
    .scorebar__inner { gap: 11px; }
    .scoredot { width: 54px; height: 54px; }
    .scoredot__val { font-size: 19px; }
}

/* Manual band override */
.override {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.override.is-on { display: block; }

.bands { display: flex; flex-wrap: wrap; gap: 5px; }

.band {
    min-width: 44px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg-2);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s var(--ease);
}
.band:hover { border-color: var(--gold-lite); background: #FFFDF7; }
.band.is-on {
    border-color: var(--gold);
    background: linear-gradient(180deg, var(--ink-3), var(--ink));
    color: var(--gold-lite);
}

/* ==========================================================================
   Submit
   ========================================================================== */

.submit {
    width: 100%;
    margin-top: 22px;
    padding: 16px 20px;
    border: 0;
    border-radius: var(--r-lg);
    background: linear-gradient(145deg, var(--ink-3), var(--ink));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(14, 23, 38, .26);
    transition: transform .16s var(--ease), box-shadow .22s var(--ease), opacity .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.submit:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(14, 23, 38, .32); }
.submit:active { transform: translateY(0); }
.submit[disabled] { opacity: .6; pointer-events: none; }
.submit svg { width: 17px; height: 17px; fill: var(--gold-lite); }

.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: var(--gold-lite);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.formnote {
    margin-top: 11px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

/* ==========================================================================
   Success overlay
   ========================================================================== */

.done {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(14, 23, 38, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.done.is-on { display: grid; animation: fade .25s var(--ease); }

@keyframes fade { from { opacity: 0; } }

.done__card {
    width: 100%;
    max-width: 400px;
    padding: 32px 28px 26px;
    border-radius: var(--r-xl);
    background: var(--paper);
    box-shadow: var(--sh-3);
    text-align: center;
    animation: rise .35s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.done__ring {
    width: 66px; height: 66px;
    margin: 0 auto 16px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--green-bg);
}
.done__ring svg { width: 30px; height: 30px; stroke: var(--green); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.done__ring--warn { background: var(--amber-bg); }
.done__ring--warn svg { stroke: var(--amber); }

.done__title { font-family: var(--display); font-size: 23px; font-weight: 600; }
.done__text { margin-top: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }

.done__band {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    margin: 16px 0 4px;
    padding: 9px 18px;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--ink-3), var(--ink));
    color: var(--gold-lite);
}
.done__band b { font-family: var(--display); font-size: 22px; font-weight: 700; }
.done__band span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }

.done__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }

/* ==========================================================================
   Records page
   ========================================================================== */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}
.toolbar form { display: flex; gap: 9px; flex: 1; min-width: 240px; }
.toolbar .input { flex: 1; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill--sent   { background: var(--green-bg); color: var(--green); }
.pill--failed { background: var(--red-bg);   color: var(--red); }
.pill--pending{ background: var(--amber-bg); color: var(--amber); }

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

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    padding: 11px 14px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: #FCFCFE; }

.table__name { font-weight: 600; }
.table__meta { font-size: 12px; color: var(--muted); }

.bandtag {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    padding: 5px 9px;
    border-radius: var(--r-sm);
    background: linear-gradient(145deg, var(--ink-3), var(--ink));
    color: var(--gold-lite);
    font-family: var(--display);
    font-size: 14px;
    font-weight: 700;
}

.rowacts { display: flex; gap: 6px; justify-content: flex-end; }

.empty { padding: 56px 24px; text-align: center; }
.empty__icon { font-size: 30px; opacity: .35; }
.empty__title { margin-top: 10px; font-size: 15px; font-weight: 600; }
.empty__text { margin-top: 5px; font-size: 13px; color: var(--muted); }

.pager { display: flex; justify-content: center; margin-top: 18px; }
.pager svg { width: 18px; height: 18px; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 100;
    transform: translate(-50%, 120%);
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--sh-3);
    transition: transform .35s var(--ease);
}
.toast.is-on { transform: translate(-50%, 0); }
.toast__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.toast--bad .toast__dot { background: #F08A8A; }

/* ==========================================================================
   Misc
   ========================================================================== */

.footnote {
    margin-top: 26px;
    text-align: center;
    font-size: 11.5px;
    color: var(--faint);
    letter-spacing: .02em;
}

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