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

:root {
    color-scheme: dark;

    --color-background-primary: #1c1c1a;
    --color-background-secondary: #252523;
    --color-background-tertiary: #161614;
    --color-background-info: #042c53;
    --color-background-danger: #501313;
    --color-background-success: #173404;
    --color-background-warning: #412402;

    --color-text-primary: #f0ede8;
    --color-text-secondary: #b4b2a9;
    --color-text-tertiary: #888780;
    --color-text-info: #85b7eb;
    --color-text-danger: #f09595;
    --color-text-success: #97c459;
    --color-text-warning: #ef9f27;

    --color-border-primary: rgba(255, 255, 255, 0.30);
    --color-border-secondary: rgba(255, 255, 255, 0.18);
    --color-border-tertiary: rgba(255, 255, 255, 0.10);

    /* Brand accent scale */
    --brand: #16a37b;
    --brand-strong: #0f6e56;
    --brand-soft: #0e2f27;
    --brand-text: #7fe0c1;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.55);
    --ring: 0 0 0 3px rgba(22, 163, 123, 0.18);

    --border-radius-sm: 6px;
    --border-radius-md: 9px;
    --border-radius-lg: 13px;
    --border-radius-xl: 18px;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Roboto Mono', ui-monospace, monospace;
}


html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--color-background-tertiary);
    color: var(--color-text-primary);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Forms */
input,
select,
textarea {
    font-family: inherit;
    font-size: 15px;
}

/* Buttons */
.btn {
    padding: 8px 15px;
    border-radius: var(--border-radius-md);
    border: 0.5px solid var(--color-border-secondary);
    background: var(--color-background-primary);
    color: var(--color-text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

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

.btn:active {
    transform: translateY(0.5px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-primary {
    background: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
    box-shadow: 0 1px 2px rgba(15, 110, 86, 0.25);
}

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

/* Auto Assign All */
.btn-accent {
    background: var(--brand-soft);
    color: var(--brand-text);
    border: 1px solid var(--brand);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(22, 163, 123, 0.10);
}

.btn-accent:hover:not(:disabled) {
    background: var(--brand-strong);
    border-color: var(--brand-text);
    color: #ffffff;
}

/* Remind */
.btn-accent-text {
    color: var(--brand-text);
}

/* "Change?" red for admin's own learners and grey (+ disabled) for others */
.btn-soft-danger {
    background: var(--color-background-danger);
    color: var(--color-text-danger);
    border: 1px solid rgba(240, 149, 149, 0.30);
}

.btn-soft-danger:hover:not(:disabled) {
    background: #5f1717;
    border-color: var(--color-text-danger);
}

.btn-soft-danger:disabled {
    background: var(--color-background-secondary);
    color: var(--color-text-tertiary);
    border-color: var(--color-border-tertiary);
    opacity: 0.75;
}

.btn-danger {
    background: var(--color-background-danger);
    color: var(--color-text-danger);
    border-color: transparent;
    box-shadow: none;
}

.btn-danger:hover {
    background: #f7dcdc;
}

.btn-sm {
    padding: 5px 11px;
    font-size: 13px;
}

/* Cards */
.card {
    background: var(--color-background-primary);
    border: 0.5px solid var(--color-border-tertiary);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* Badges (shared) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.badge-active {
    background: var(--color-background-warning) !important;
    color: var(--color-text-warning) !important;
    border: 0.5px solid rgba(239, 159, 39, 0.2) !important;
}

.badge-done {
    background: var(--color-background-success) !important;
    color: var(--color-text-success) !important;
    border: 0.5px solid rgba(22, 163, 123, 0.2) !important;
}

.badge-paused {
    background: #faeeda;
    color: #633806;
}

.badge-notstarted {
    background: var(--color-background-primary) !important;
    color: var(--color-text-secondary) !important;
    border: 0.5px solid var(--color-border-secondary) !important;
}

/* Progress bar (shared base) */
.progress-bar {
    background: var(--color-background-tertiary);
    border-radius: 999px;
    height: 7px;
    overflow: hidden;
    flex: 1;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #2bc18f);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-wrap {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --px: 0;
    --py: 0;
    --mx: 50%;
    --my: 50%;

    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.25rem;
    overflow: hidden;
    isolation: isolate;
    perspective: 1600px;
    perspective-origin: 50% 44%;
    color: #ffffff;
    background:
        radial-gradient(1180px 640px at 50% -16%, rgba(43, 193, 143, 0.38), transparent 60%),
        radial-gradient(900px 420px at 50% 104%, rgba(22, 163, 123, 0.30), transparent 66%),
        radial-gradient(760px 620px at 4% 34%, rgba(15, 110, 86, 0.22), transparent 62%),
        radial-gradient(700px 580px at 100% 60%, rgba(15, 110, 86, 0.20), transparent 62%),
        linear-gradient(170deg, #0f1d18 0%, #0a1411 40%, #060c0a 72%, #040807 100%);
}

.scene-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bloom {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform, opacity;
}

.bloom.bloom-top {
    width: 78vw;
    max-width: 1180px;
    height: 52vh;
    top: -22vh;
    left: 50%;
    margin-left: -39vw;
    background: radial-gradient(closest-side, rgba(43, 193, 143, 0.42), rgba(22, 163, 123, 0.14) 58%, transparent 78%);
    animation: bloom-breathe 26s ease-in-out infinite;
    transform: translate3d(calc(var(--px) * -26px), calc(var(--py) * -18px), 0);
}

.bloom.bloom-base {
    width: 62vw;
    max-width: 900px;
    height: 44vh;
    bottom: -18vh;
    left: -10vw;
    background: radial-gradient(closest-side, rgba(15, 110, 86, 0.50), transparent 74%);
    animation: bloom-breathe 32s ease-in-out infinite -12s;
    transform: translate3d(calc(var(--px) * 22px), calc(var(--py) * 16px), 0);
}

.grid-floor {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 200%;
    height: 105%;
    transform: translateX(-50%) perspective(1000px) rotateX(64deg);
    transform-origin: 50% 100%;
    background-image:
        linear-gradient(to right, rgba(127, 224, 193, 0.30) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(127, 224, 193, 0.30) 1px, transparent 1px);
    background-size: 84px 84px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 10%, rgba(0, 0, 0, 0.55) 48%, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 10%, rgba(0, 0, 0, 0.55) 48%, #000 100%);
    opacity: 0.75;
    animation: grid-drift 30s linear infinite;
}


.horizon {
    position: absolute;
    left: 50%;
    bottom: 20%;
    width: 92%;
    max-width: 1250px;
    height: 240px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, rgba(53, 211, 161, 0.42), transparent 74%);
    filter: blur(52px);
    opacity: 0.8;
}

.scene-grain {
    position: absolute;
    inset: 0;
    opacity: 0.16;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

.scene-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(125% 100% at 50% 40%, transparent 48%, rgba(0, 0, 0, 0.42) 100%);
}

/* ---------- the stage ---------- */
.login-stage {
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.login-stage.tracking {
    transition: transform 0.12s linear;
}

.login-box {
    position: relative;
    width: 100%;
    max-width: 412px;
    transform-style: preserve-3d;
}

/* ---------- identity ---------- */
.login-logo {
    text-align: center;
    margin-bottom: 2rem;
    transform-style: preserve-3d;
    transform: translateZ(34px);
    animation: enter-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.04s backwards;
}

.login-logo .icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    margin-bottom: 1.35rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(155deg, #35d3a1 0%, var(--brand) 52%, var(--brand-strong) 100%);
    box-shadow:
        0 20px 40px -16px rgba(22, 163, 123, 0.75),
        0 4px 12px -4px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -8px 18px rgba(8, 80, 65, 0.42);
    transform: translateZ(18px);
}

/* soft halo, no motion */
.login-logo .icon-wrap::before {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 32px;
    background: radial-gradient(closest-side, rgba(43, 193, 143, 0.38), transparent 72%);
    filter: blur(10px);
    z-index: -1;
}

.login-logo .icon-wrap i {
    font-size: 31px;
    line-height: 1;
    color: #ffffff;
}

.login-logo h1 {
    font-size: 29px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: 10px;
    color: #ffffff;
}

.login-logo p {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.62);
    max-width: 340px;
    margin: 0 auto;
}

/* ---------- glass panel ---------- */
.glass-card {
    position: relative;
    padding: 2.25rem 2rem 2rem;
    border-radius: 24px;
    transform-style: preserve-3d;
    animation: enter-card 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.12s backwards;
}

/* frosted pane */
.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    border-radius: inherit;
    transform: translateZ(-1px);
    background: linear-gradient(158deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 52%, rgba(255, 255, 255, 0.10) 100%);
    -webkit-backdrop-filter: blur(34px) saturate(170%);
    backdrop-filter: blur(34px) saturate(170%);
    box-shadow:
        0 44px 80px -34px rgba(0, 0, 0, 0.80),
        0 18px 36px -22px rgba(0, 0, 0, 0.60),
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

/* hairline edge — bright where light hits, emerald where it falls away */
.glass-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    background: linear-gradient(158deg,
            rgba(255, 255, 255, 0.72) 0%,
            rgba(255, 255, 255, 0.14) 30%,
            rgba(255, 255, 255, 0.05) 58%,
            rgba(43, 193, 143, 0.45) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
}

/* hairline frame set back in space */
.glass-stack {
    position: absolute;
    inset: -18px;
    z-index: -3;
    border-radius: 32px;
    transform: translateZ(-58px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: linear-gradient(158deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    pointer-events: none;
}

/* emerald bloom behind the panel */
.card-glow {
    position: absolute;
    inset: -14% -12%;
    z-index: -4;
    border-radius: 50%;
    transform: translateZ(-96px);
    background: radial-gradient(closest-side, rgba(43, 193, 143, 0.60), rgba(22, 163, 123, 0.16) 56%, transparent 78%);
    filter: blur(40px);
    pointer-events: none;
}

/* light that follows the cursor across the pane */
.sheen {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    transform: translateZ(46px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.55s ease;
    background: radial-gradient(340px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.14), transparent 62%);
}

.login-wrap:hover .sheen {
    opacity: 1;
}

/* ---------- fields ---------- */
.login-wrap .form-group {
    margin-bottom: 1.15rem;
    transform: translateZ(var(--z, 16px));
    animation: enter-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0.24s) backwards;
}

.login-wrap .form-group label {
    display: block;
    margin-bottom: 9px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: rgba(255, 255, 255, 0.72);
}

.login-wrap .form-group input {
    padding: 13px 14px;
    font-size: 15.5px;
    color: #ffffff;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.055);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.login-wrap .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.login-wrap .form-group input:hover {
    background: rgba(255, 255, 255, 0.085);
    border-color: rgba(255, 255, 255, 0.22);
}

.login-wrap .form-group input:focus {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(43, 193, 143, 0.70);
    box-shadow:
        0 0 0 3px rgba(22, 163, 123, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* keep autofill from punching a white box through the glass */
.login-wrap .form-group input:-webkit-autofill,
.login-wrap .form-group input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff;
    caret-color: #ffffff;
    box-shadow: 0 0 0 1000px #10201b inset, 0 0 0 3px rgba(22, 163, 123, 0.20);
}

.login-wrap .field .lead-icon {
    left: 14px;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.42);
    transition: color 0.25s ease;
}

.login-wrap .field input {
    padding-left: 40px !important;
    padding-right: 44px !important;
}

.login-wrap .field:focus-within .lead-icon {
    color: #35d3a1;
}

.login-wrap .pw-toggle {
    right: 7px;
    color: rgba(255, 255, 255, 0.48);
    border-radius: 9px;
    transition: color 0.2s ease, background 0.2s ease;
}

.login-wrap .pw-toggle:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.10);
}

/* ---------- one-time code: six single-character boxes ---------- */
.otp-boxes {
    display: flex;
    gap: 9px;
    width: 100%;
}

.login-wrap .otp-boxes input {
    flex: 1 1 0;
    min-width: 0;
    padding: 13px 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 600;
    caret-color: #35d3a1;
}

/* The box being typed into reads as the cursor position. */
.login-wrap .otp-boxes input:focus {
    transform: translateY(-1px);
    border-color: rgba(43, 193, 143, 0.85);
}

.login-wrap .otp-boxes input.filled {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.30);
}

/* A wrong code marks every box, not just the one under the cursor. */
.login-wrap .otp-boxes.invalid input {
    border-color: rgba(255, 140, 140, 0.75);
    background: rgba(146, 38, 38, 0.30);
}

@media (max-width: 420px) {
    .otp-boxes {
        gap: 6px;
    }

    .login-wrap .otp-boxes input {
        padding: 11px 0;
        font-size: 19px;
    }
}

.login-wrap .err-box {
    transform: translateZ(14px);
    margin-bottom: 14px;
    padding: 10px 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: #ffdcdc;
    border: 1px solid rgba(255, 150, 150, 0.34);
    border-left: 2.5px solid rgba(255, 140, 140, 0.75);
    border-radius: 12px;
    background: rgba(146, 38, 38, 0.44);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.login-wrap .err-box.shake {
    animation: err-nudge 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* ---------- action ---------- */
.login-wrap .btn-primary {
    --z: 24px;
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
    padding: 14px !important;
    font-size: 15.5px !important;
    font-weight: 600;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(150deg, #35d3a1 0%, var(--brand) 52%, #0f8a68 100%);
    box-shadow:
        0 18px 34px -14px rgba(22, 163, 123, 0.80),
        0 3px 8px -3px rgba(0, 0, 0, 0.50),
        inset 0 1px 0 rgba(255, 255, 255, 0.36);
    transform: translateZ(var(--z));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, filter 0.3s ease;
    animation: enter-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.36s backwards;
}

/* single sheen pass on hover only — no idle loop */
.login-wrap .btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.30) 50%, transparent 68%);
}

.login-wrap .btn-primary:hover:not(:disabled)::after {
    animation: sheen-pass 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-wrap .btn-primary:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateZ(var(--z)) translateY(-1.5px);
    box-shadow:
        0 24px 44px -16px rgba(22, 163, 123, 0.90),
        0 4px 10px -3px rgba(0, 0, 0, 0.50),
        inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.login-wrap .btn-primary:active:not(:disabled) {
    transform: translateZ(var(--z)) translateY(0.5px);
    box-shadow:
        0 8px 18px -10px rgba(22, 163, 123, 0.70),
        inset 0 2px 5px rgba(8, 80, 65, 0.45);
}

.login-wrap .btn-primary i {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-wrap .btn-primary:hover:not(:disabled) i {
    transform: translateX(3px);
}

.login-wrap .btn-primary:disabled {
    opacity: 0.9;
}

.login-wrap .btn-primary .spin {
    animation: spin 0.8s linear infinite;
}

.login-wrap .footer-bar {
    --z: 4px;
    padding: 1.75rem 1rem 0;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.52);
    transform: translateZ(var(--z));
    animation: enter-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.46s backwards;
}

/* ---------- motion ---------- */
@keyframes bloom-breathe {

    0%,
    100% {
        opacity: 0.80;
    }

    50% {
        opacity: 1;
    }
}

@keyframes grid-drift {
    to {
        background-position: 0 78px, 0 78px;
    }
}

@keyframes enter-up {
    from {
        opacity: 0;
        transform: translate3d(0, 12px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, var(--z, 16px));
    }
}

@keyframes enter-card {
    from {
        opacity: 0;
        transform: translate3d(0, 22px, -60px);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes sheen-pass {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

@keyframes err-nudge {

    0%,
    100% {
        transform: translateZ(14px) translateX(0);
    }

    22%,
    66% {
        transform: translateZ(14px) translateX(-4px);
    }

    44%,
    88% {
        transform: translateZ(14px) translateX(4px);
    }
}

/* ---------- narrow screens ---------- */
@media (max-width: 520px) {
    .login-wrap {
        padding: 2rem 1.15rem;
        perspective: none;
    }

    .login-box {
        max-width: 100%;
    }

    .glass-card {
        padding: 1.85rem 1.35rem 1.6rem;
        border-radius: 22px;
    }

    .glass-stack {
        display: none;
    }

    .login-logo h1 {
        font-size: 25.5px;
    }

    .login-logo p {
        font-size: 14.5px;
    }
}

/* the login canvas is intentionally identical in both colour schemes */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 11px;
    border: 0.5px solid var(--color-border-secondary);
    border-radius: var(--border-radius-md);
    background: var(--color-background-primary);
    color: var(--color-text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--color-border-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--ring);
}

.err-box {
    display: none;
    color: var(--color-text-danger);
    font-size: 13px;
    margin-bottom: 10px;
    padding: 9px 11px;
    background: var(--color-background-danger);
    border-radius: var(--border-radius-md);
}

.footer-bar {
    text-align: center;
    padding: 1.5rem;
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.field .lead-icon {
    position: absolute;
    left: 11px;
    font-size: 17px;
    color: var(--color-text-tertiary);
    pointer-events: none;
    z-index: 4;
}

.field input {
    padding-left: 34px !important;
    padding-right: 42px !important;
}

.field input:focus~.lead-icon {
    color: var(--brand);
}

.pw-toggle {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 6px;
    border-radius: var(--border-radius-sm);
    display: inline-flex;
    line-height: 1;
    z-index: 5;
}

.pw-toggle:hover {
    color: var(--brand);
    background: var(--color-background-secondary);
}

.pw-toggle i {
    font-size: 17px;
}



/* Copy-to-clipboard button (candidate credentials) */
.copy-btn {
    background: none;
    border: 0.5px solid transparent;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 5px;
    border-radius: var(--border-radius-sm);
    display: inline-flex;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
    color: var(--brand-text);
    background: var(--brand-soft);
}

.copy-btn i {
    font-size: 16px;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    color: var(--color-text-primary);
}

th.sortable .sort-ind {
    opacity: 0.4;
    font-size: 12px;
    margin-left: 3px;
}

th.sortable.active {
    color: var(--brand-text);
}

th.sortable.active .sort-ind {
    opacity: 1;
}

/* Table status row highlights */
tr.row-complete td {
    background-color: rgba(22, 163, 123, 0.04) !important;
}

tr.row-complete td:first-child {
    border-left: 3.5px solid var(--brand) !important;
}

tr.row-progress td {
    background-color: rgba(239, 159, 39, 0.03) !important;
}

tr.row-progress td:first-child {
    border-left: 3.5px solid #ef9f27 !important;
}

tr.row-notstarted td {
    background-color: var(--color-background-primary) !important;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.toast {
    background: var(--color-background-primary);
    border: 0.5px solid var(--color-border-tertiary);
    border-left: 3px solid var(--brand);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: slide-in 0.25s ease both;
}

.toast.leaving {
    animation: slide-out 0.2s ease both;
}

.toast.error {
    border-left-color: var(--color-text-danger);
}

.toast .toast-icon {
    font-size: 19.5px;
    line-height: 1;
    margin-top: 1px;
}

.toast .toast-title {
    font-weight: 600;
    font-size: 14px;
}

.toast .toast-msg {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: 2px;
    white-space: pre-line;
}

.toast .toast-body {
    flex: 1;
}

.toast .toast-close {
    background: none;
    border: none;
    padding: 0;
    margin-top: 1px;
    color: var(--color-text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.toast .toast-close:hover {
    color: var(--color-text-primary);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg,
            var(--color-background-secondary) 25%,
            var(--color-background-tertiary) 37%,
            var(--color-background-secondary) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

.skeleton-line {
    height: 11px;
    margin: 7px 0;
}

/* Quiet inline action — "Resend code", "Use a different email" */
.link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-family: inherit;
    color: var(--color-text-secondary);
    text-decoration: underline;
    cursor: pointer;
}

.link-btn:hover:not(:disabled) {
    color: var(--color-text-primary);
}

.link-btn:disabled {
    opacity: 0.55;
    cursor: default;
    text-decoration: none;
}

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

.spin {
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-out {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: rise 0.35s ease both;
}

/* Custom Combobox Select Component */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: 0.5px solid var(--color-border-secondary);
    border-radius: var(--border-radius-md);
    background: var(--color-background-primary);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    font-size: 15px;
}

.custom-select-trigger:hover {
    border-color: var(--color-border-primary);
}

.custom-select-container.open .custom-select-trigger {
    border-color: var(--brand);
    box-shadow: var(--ring);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: var(--color-background-primary);
    border: 0.5px solid var(--color-border-secondary);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 280px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: selectFadeIn 0.15s ease;
}

.custom-select-dropdown.drop-up {
    top: auto;
    bottom: calc(100% + 5px);
    animation: selectFadeInUp 0.15s ease;
}

@keyframes selectFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes selectFadeInUp {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select-search-wrap {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 0.5px solid var(--color-border-tertiary);
    background: var(--color-background-secondary);
}

.custom-select-search-wrap i {
    color: var(--color-text-tertiary);
    margin-right: 8px;
    font-size: 15px;
}

.custom-select-search-wrap input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 14px !important;
    color: var(--color-text-primary) !important;
    box-shadow: none !important;
    width: 100%;
}

.custom-select-search-wrap input:focus {
    outline: none !important;
}

.custom-select-options-list {
    overflow-y: auto;
    max-height: 220px;
}

.custom-select-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.1s ease;
    border-bottom: 0.5px solid var(--color-border-tertiary);
    text-align: left;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background: var(--color-background-secondary);
}

.custom-select-option.selected {
    background: var(--brand-soft);
    color: var(--brand-text);
    font-weight: 500;
}

.custom-select-option .option-title {
    font-weight: 500;
    color: var(--color-text-primary);
}

.custom-select-option.selected .option-title {
    color: var(--brand-text);
}

.custom-select-option .option-meta {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.custom-select-option.selected .option-meta {
    color: var(--brand-text);
    opacity: 0.8;
}

.custom-select-no-results {
    padding: 12px;
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 14px;
}

/* Toggle switch */
.switch {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
    user-select: none;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .switch-track {
    position: relative;
    flex: none;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: var(--color-background-tertiary);
    border: 0.5px solid var(--color-border-secondary);
    transition: background 0.18s ease, border-color 0.18s ease;
}

.switch .switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: var(--shadow-sm), 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.switch:hover .switch-track {
    border-color: var(--color-border-primary);
}

.switch input:checked+.switch-track {
    background: var(--brand);
    border-color: transparent;
}

.switch input:checked+.switch-track::after {
    transform: translateX(16px);
}

.switch input:focus-visible+.switch-track {
    outline: 2px solid var(--color-text-info);
    outline-offset: 2px;
}

.switch input:checked~.switch-label {
    color: var(--color-text-primary);
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}