/* ==========================================================================
   CRH LOGIN — sign in / forgot password / reset password.
   Standalone on purpose: these screens load only this file (no app.css),
   so the first paint stays fast. Every class and variable starts with "crh".

   Scaling:
   - Left showcase: a 720x853 design stage (--u = one design pixel) that
     always fits the window, so nothing scrolls or leaves a band.
   - Right form card: --fu scales the card with the window, with a floor on
     font sizes so text stays readable on small laptops.
   ========================================================================== */

@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/geist-latin-variable.woff2') format('woff2');
}

@font-face {
    font-family: 'Great Vibes';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/GreatVibes-Regular.ttf') format('truetype');
}

:root {
    --crh-primary: #4338e8;
    --crh-primary-hover: #382fcf;
    --crh-primary-soft: #eeedff;
    --crh-primary-ring: rgba(67, 56, 232, .16);

    --crh-ink: #0f1330;
    --crh-ink-2: #3a4160;
    --crh-muted: #6a7090;
    --crh-faint: #8d93ad;

    --crh-line: #e4e6f2;
    --crh-line-strong: #d3d7e8;
    --crh-wash: #f4f4ff;

    --crh-success: #15a24f;
    --crh-success-soft: #e6f8ee;
    --crh-danger: #d83a40;
    --crh-danger-soft: #ffeeef;

    --crh-ease: cubic-bezier(.2, .7, .2, 1);
    --crh-ease-spring: cubic-bezier(.34, 1.4, .5, 1);

    --crh-fu: clamp(.9px, min(calc(100vw / 1280), calc(100dvh / 853)), 1.7px);
}

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

.crh-login-body {
    margin: 0;
    min-height: 100dvh;
    font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--crh-ink);
    background: #fff;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

:where(.crh-login-body) svg { display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:where(.crh-login-body) a { color: inherit; }
:where(.crh-login-body) :is(button, input) { font: inherit; color: inherit; }

/* ---- Page grid ----------------------------------------------------------- */
.crh-login {
    display: grid;
    grid-template-columns: minmax(0, 9fr) minmax(0, 7fr);
    min-height: 100dvh;
}

/* ==========================================================================
   LEFT — showcase
   ========================================================================== */
.crh-login-showcase {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(180deg, #f8f8ff 0%, #f1f1fd 100%);
    isolation: isolate;
}

/* Background as in the reference: a pale lilac wash with a large oval at the top
   right and a swooping ribbon at the bottom right. The soft glows behind them
   drift slowly; only transform animates, so it stays on the GPU. */
.crh-login-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.crh-login-glow__blob {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}
.crh-login-glow__blob.is-a {
    width: 60%; aspect-ratio: 1; left: -18%; top: -14%;
    background: radial-gradient(closest-side, rgba(99, 91, 255, .13), rgba(99, 91, 255, 0));
    animation: crh-login-drift-a 22s ease-in-out infinite alternate;
}
.crh-login-glow__blob.is-b {
    width: 54%; aspect-ratio: 1; right: -16%; top: 30%;
    background: radial-gradient(closest-side, rgba(150, 140, 255, .10), rgba(150, 140, 255, 0));
    animation: crh-login-drift-b 26s ease-in-out infinite alternate;
}
.crh-login-glow__blob.is-c {
    width: 50%; aspect-ratio: 1; left: 0; bottom: -24%;
    background: radial-gradient(closest-side, rgba(170, 140, 255, .11), rgba(170, 140, 255, 0));
    animation: crh-login-drift-c 30s ease-in-out infinite alternate;
}

.crh-login-glow__sweep {
    position: absolute;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .8);
}
.crh-login-glow__sweep.is-top {
    width: 58%; aspect-ratio: 1.1; right: -14%; top: -22%;
    background: radial-gradient(circle at 28% 78%, #f1f1fc 0%, #e6e6f8 62%, #e0e0f5 100%);
    transform: rotate(-14deg);
}
.crh-login-glow__sweep.is-bottom {
    width: 104%; aspect-ratio: 1.15; right: -46%; bottom: -54%;
    background: linear-gradient(160deg, #efeffc 0%, #e4e4f8 100%);
    transform: rotate(-12deg);
}
.crh-login-glow__sweep.is-bottom::before {
    content: '';
    position: absolute; inset: 5%;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .55);
}

@keyframes crh-login-drift-a { to { transform: translate3d(9%, 7%, 0) scale(1.08); } }
@keyframes crh-login-drift-b { to { transform: translate3d(-10%, -6%, 0) scale(1.1); } }
@keyframes crh-login-drift-c { to { transform: translate3d(8%, -8%, 0) scale(1.06); } }

/* Stage: 720 x 853 design pixels, scaled to fit. 1 design px = var(--u). */
.crh-login-stagebox {
    --u: calc(100cqw / 720);
    position: relative;
    width: min(100%, calc(100dvh * 720 / 853));
    aspect-ratio: 720 / 853;
    container-type: inline-size;
}

.crh-login-at {
    position: absolute;
    left: calc(var(--x) * var(--u));
    top: calc(var(--y) * var(--u));
    width: calc(var(--w) * var(--u));
}

/* Headline block */
.crh-login-copy { animation: crh-login-reveal .8s var(--crh-ease) both; }

.crh-login-pill {
    display: inline-flex;
    align-items: center;
    gap: calc(10 * var(--u));
    padding: calc(6 * var(--u)) calc(12 * var(--u));
    border-radius: 999px;
    background: #e9e9fd;
    color: var(--crh-primary);
    font-size: max(11px, calc(13 * var(--u)));
    font-weight: 500;
    white-space: nowrap;
}
.crh-login-pill i { width: 1px; height: 1em; background: rgba(67, 56, 232, .45); }

.crh-login-headline {
    margin: calc(20 * var(--u)) 0 0;
    font-size: max(28px, calc(49 * var(--u)));
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.035em;
    white-space: nowrap;
}

.crh-login-lead {
    margin: calc(22 * var(--u)) 0 0;
    max-width: calc(330 * var(--u));
    font-size: max(12px, calc(16.5 * var(--u)));
    line-height: 1.55;
    color: var(--crh-muted);
}

/* Feature list */
.crh-login-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: calc(22 * var(--u));
    animation: crh-login-reveal .8s .15s var(--crh-ease) both;
}
.crh-login-features li { display: flex; align-items: center; gap: calc(18 * var(--u)); }
.crh-login-features__icon {
    display: grid;
    place-items: center;
    width: calc(52 * var(--u));
    height: calc(52 * var(--u));
    flex: none;
    border-radius: calc(14 * var(--u));
    background: #ecebfd;
    color: var(--crh-primary);
}
.crh-login-features__icon svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); min-width: 15px; min-height: 15px; }
.crh-login-features b { display: block; font-size: max(12px, calc(15.5 * var(--u))); font-weight: 600; }
.crh-login-features small { display: block; margin-top: calc(4 * var(--u)); font-size: max(11px, calc(13.2 * var(--u))); color: var(--crh-muted); white-space: nowrap; }

/* Floating cards */
.crh-login-float {
    --mx: 0;
    --my: 0;
    transform:
        translate(calc(var(--mx) * var(--d) * 7 * var(--u)), calc(var(--my) * var(--d) * 7 * var(--u)))
        rotate(var(--r));
    animation: crh-login-pop .9s calc(.25s + var(--i) * .13s) var(--crh-ease-spring) both;
}

.crh-login-drift {
    animation: crh-login-float 7s ease-in-out infinite alternate;
}
.crh-login-drift.is-delay { animation-delay: -3.5s; animation-duration: 8s; }

.crh-login-tile {
    padding: calc(14 * var(--u)) calc(16 * var(--u));
    border-radius: calc(16 * var(--u));
    background: #fff;
    box-shadow:
        0 calc(1 * var(--u)) calc(2 * var(--u)) rgba(15, 19, 48, .04),
        0 calc(14 * var(--u)) calc(34 * var(--u)) rgba(67, 56, 232, .13);
}
.crh-login-tile.is-fixed { display: flex; flex-direction: column; justify-content: space-between; height: calc(136 * var(--u)); }
.crh-login-tile.is-fixed .crh-login-stat { margin-top: 0; }
.crh-login-tile.is-fixed .crh-login-trend { margin-top: 0; }
.crh-login-tile__label { display: block; font-size: max(9px, calc(12 * var(--u))); font-weight: 500; color: var(--crh-ink-2); }

.crh-login-stat { display: flex; align-items: center; gap: calc(12 * var(--u)); margin-top: calc(12 * var(--u)); }
.crh-login-stat__icon {
    display: grid; place-items: center;
    width: calc(40 * var(--u)); height: calc(40 * var(--u));
    border-radius: calc(12 * var(--u));
    background: #ecebfd; color: var(--crh-primary);
}
.crh-login-stat__icon svg { width: 55%; height: 55%; }
.crh-login-stat__value { font-size: max(14px, calc(30 * var(--u))); font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.crh-login-stat__value.is-big { font-size: max(16px, calc(36 * var(--u))); }

.crh-login-trend {
    display: inline-flex; align-items: center; gap: calc(3 * var(--u));
    margin-top: calc(8 * var(--u));
    font-size: max(8px, calc(11.5 * var(--u))); font-weight: 600; color: var(--crh-success);
}
.crh-login-trend svg { width: calc(12 * var(--u)); height: calc(12 * var(--u)); stroke-width: 2.4; }
.crh-login-trend em { font-style: normal; font-weight: 400; color: var(--crh-muted); margin-left: calc(3 * var(--u)); }

/* Hiring progress bars */
.crh-login-bars {
    display: flex; align-items: flex-end; justify-content: space-between;
    height: calc(72 * var(--u));
}
.crh-login-bars i {
    width: calc(10 * var(--u));
    height: calc(var(--h) * .95 * var(--u));
    border-radius: calc(4 * var(--u));
    background: linear-gradient(180deg, #5a4ff0, #c9c4ff);
    transform-origin: bottom;
    animation: crh-login-grow .8s calc(.9s + var(--n, 0) * .06s) var(--crh-ease) both;
}
.crh-login-bars i:nth-child(1) { --n: 0; opacity: .55; }
.crh-login-bars i:nth-child(2) { --n: 1; opacity: .6; }
.crh-login-bars i:nth-child(3) { --n: 2; opacity: .66; }
.crh-login-bars i:nth-child(4) { --n: 3; opacity: .74; }
.crh-login-bars i:nth-child(5) { --n: 4; opacity: .82; }
.crh-login-bars i:nth-child(6) { --n: 5; opacity: .9; }
.crh-login-bars i:nth-child(7) { --n: 6; opacity: .95; }
.crh-login-bars i:nth-child(8) { --n: 7; opacity: 1; background: linear-gradient(180deg, #3a2ee0, #6b5ff5); }

/* Candidate list */
.crh-login-people { list-style: none; margin: 0; padding: 0; }
.crh-login-people li {
    display: flex; align-items: center; gap: calc(12 * var(--u));
    padding: calc(11 * var(--u)) 0;
}
.crh-login-people li + li { border-top: 1px solid #eef0f8; }
.crh-login-people li:first-child { padding-top: 0; }
.crh-login-people li:last-child { padding-bottom: 0; }
.crh-login-people li > span:nth-child(2) { flex: 1; min-width: 0; }
.crh-login-people b { display: block; font-size: max(9px, calc(13.5 * var(--u))); font-weight: 600; white-space: nowrap; }
.crh-login-people small { display: block; margin-top: calc(2 * var(--u)); font-size: max(8px, calc(11.5 * var(--u))); color: var(--crh-muted); white-space: nowrap; }
.crh-login-avatar { width: calc(36 * var(--u)); height: calc(36 * var(--u)); border-radius: 50%; stroke: none; }

.crh-login-badge {
    display: grid; place-items: center;
    width: calc(30 * var(--u)); height: calc(30 * var(--u));
    border-radius: calc(9 * var(--u));
}
.crh-login-badge svg { width: 56%; height: 56%; }
.crh-login-badge.is-violet { background: #ecebfd; color: var(--crh-primary); }
.crh-login-badge.is-orange { background: #ffeed9; color: #f08a1c; }
.crh-login-badge.is-green  { background: #def7e8; color: var(--crh-success); }

/* Joinings + sparkline */
.crh-login-joinings { display: flex; align-items: flex-end; justify-content: space-between; gap: calc(12 * var(--u)); margin-top: calc(8 * var(--u)); }
.crh-login-joinings > div { display: flex; align-items: baseline; gap: calc(8 * var(--u)); }
.crh-login-joinings .crh-login-trend { margin: 0; }
.crh-login-spark { width: calc(124 * var(--u)); height: calc(52 * var(--u)); overflow: visible; stroke-width: 0; }
.crh-login-spark__line { stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: crh-login-draw 1.6s 1.1s var(--crh-ease) forwards; }
.crh-login-spark__area { opacity: 0; animation: crh-login-fade 1s 1.8s ease forwards; }

/* Handwritten line */
.crh-login-script { animation: crh-login-fade 1.4s 1.2s ease both; }
.crh-login-script p {
    margin: 0;
    font-family: 'Great Vibes', 'Segoe Script', 'Brush Script MT', cursive;
    font-size: max(16px, calc(33 * var(--u)));
    line-height: 1.12;
    color: #a9a8d6;
    transform: rotate(-6deg);
    transform-origin: left bottom;
}
.crh-login-script svg { width: calc(110 * var(--u)); height: calc(10 * var(--u)); margin: calc(8 * var(--u)) 0 0 calc(70 * var(--u)); stroke-width: 3; }

/* ==========================================================================
   RIGHT — form panel
   ========================================================================== */
.crh-login-panel {
    position: relative;
    display: grid;
    place-items: center;
    padding: clamp(14px, calc(40 * var(--crh-fu)), 56px) clamp(14px, calc(42 * var(--crh-fu)), 64px);
    background: #fbfbfe;
}

.crh-login-card {
    width: min(100%, calc(475 * var(--crh-fu)));
    padding: calc(46 * var(--crh-fu)) calc(32 * var(--crh-fu)) calc(40 * var(--crh-fu));
    border: 1px solid var(--crh-line);
    border-radius: calc(18 * var(--crh-fu));
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 19, 48, .03), 0 24px 60px rgba(67, 56, 232, .07);
    animation: crh-login-rise .8s .1s var(--crh-ease) both;
}

.crh-login-brand { display: flex; justify-content: center; }
.crh-login-brand img { display: block; width: calc(250 * var(--crh-fu)); max-width: 100%; height: auto; }

.crh-login-head { text-align: center; margin-top: clamp(14px, calc(38 * var(--crh-fu)), 56px); }
.crh-login-head__icon {
    display: grid; place-items: center;
    width: calc(52 * var(--crh-fu)); height: calc(52 * var(--crh-fu));
    margin: 0 auto calc(12 * var(--crh-fu));
    border-radius: calc(16 * var(--crh-fu));
    background: var(--crh-primary-soft); color: var(--crh-primary);
}
.crh-login-head__icon svg { width: 46%; height: 46%; }
.crh-login-head h1 { margin: 0; font-size: max(22px, calc(28 * var(--crh-fu))); font-weight: 700; letter-spacing: -.025em; }
.crh-login-head p { margin: 6px auto 0; max-width: 34ch; font-size: max(13.5px, calc(15.5 * var(--crh-fu))); line-height: 1.5; color: var(--crh-muted); }

/* Alerts */
.crh-login-alert {
    display: flex; align-items: flex-start; gap: 10px;
    margin-top: calc(18 * var(--crh-fu));
    padding: 11px 14px;
    border-radius: 10px;
    font-size: max(13px, calc(14 * var(--crh-fu)));
    line-height: 1.45;
}
.crh-login-alert svg { width: 18px; height: 18px; margin-top: 1px; }
.crh-login-alert.is-success { background: var(--crh-success-soft); color: #0d7a3a; }
.crh-login-alert.is-error { background: var(--crh-danger-soft); color: var(--crh-danger); animation: crh-login-shake .4s ease; }

/* Form */
.crh-login-form { display: grid; gap: calc(24 * var(--crh-fu)); margin-top: calc(34 * var(--crh-fu)); }
.crh-login-field { display: grid; gap: 8px; }
.crh-login-label { font-size: max(13.5px, calc(15 * var(--crh-fu))); font-weight: 500; color: var(--crh-ink); }
.crh-login-options { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }

.crh-login-link {
    color: var(--crh-primary);
    font-size: max(12.5px, calc(14 * var(--crh-fu)));
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: color .15s;
}
.crh-login-link:hover { color: var(--crh-primary-hover); text-decoration: underline; text-underline-offset: 3px; }
.crh-login-link:focus-visible, .crh-login-back:focus-visible { outline: 2px solid var(--crh-primary); outline-offset: 3px; }

.crh-login-control {
    position: relative;
    display: flex; align-items: center;
    height: max(44px, calc(47 * var(--crh-fu)));
    border: 1px solid var(--crh-line-strong);
    border-radius: 11px;
    background: #fff;
    transition: border-color .18s, box-shadow .18s, background-color .18s;
}
.crh-login-control:hover { border-color: #b9bfd8; }
.crh-login-control:focus-within {
    border-color: var(--crh-primary);
    box-shadow: 0 0 0 3px rgba(67, 56, 232, .09);
}
.crh-login-control.has-error { border-color: var(--crh-danger); animation: crh-login-shake .4s ease; }
.crh-login-control.has-error:focus-within { box-shadow: 0 0 0 3px rgba(216, 58, 64, .1); }

.crh-login-control__icon {
    position: absolute; left: 16px;
    width: 19px; height: 19px;
    color: var(--crh-muted);
    pointer-events: none;
    transition: color .18s;
}
.crh-login-control:focus-within .crh-login-control__icon { color: var(--crh-primary); }

.crh-login-control input {
    width: 100%; height: 100%;
    padding: 0 48px;
    border: 0; border-radius: 10px; outline: 0; background: transparent;
    font-size: max(14px, calc(15.5 * var(--crh-fu)));
}
.crh-login-control input::placeholder { color: var(--crh-faint); opacity: 1; }
/* The browser paints its autofill colour as a box. Keep it as rounded as the
   field (field radius minus its 1px border) so it never covers the border corners. */
.crh-login-control input:-webkit-autofill,
.crh-login-control input:-webkit-autofill:focus {
    border-radius: 10px;
    -webkit-box-shadow: 0 0 0 40px #fff inset;
    -webkit-text-fill-color: var(--crh-ink);
}

.crh-login-toggle {
    position: absolute; right: 6px;
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border: 0; border-radius: 9px; background: transparent;
    color: var(--crh-muted); cursor: pointer;
    transition: color .15s, background-color .15s;
}
.crh-login-toggle:hover { color: var(--crh-primary); background: var(--crh-primary-soft); }
.crh-login-toggle:focus-visible { outline: 2px solid var(--crh-primary); outline-offset: 1px; }
.crh-login-toggle svg { width: 20px; height: 20px; }
.crh-login-toggle .is-hide, .crh-login-toggle[aria-pressed="true"] .is-show { display: none; }
.crh-login-toggle[aria-pressed="true"] .is-hide { display: block; }

/* Keep me signed in */
.crh-login-check {
    display: inline-flex; align-items: center; gap: 12px;
    width: fit-content;
    font-size: max(13.5px, calc(15 * var(--crh-fu)));
    cursor: pointer; user-select: none;
}
.crh-login-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.crh-login-check__box {
    display: grid; place-items: center;
    width: 22px; height: 22px;
    border: 1.5px solid var(--crh-line-strong);
    border-radius: 6px;
    background: #fff; color: #fff;
    transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s var(--crh-ease-spring);
}
.crh-login-check__box svg { width: 14px; height: 14px; stroke-width: 3; transform: scale(0); transition: transform .2s var(--crh-ease-spring); }
.crh-login-check:hover .crh-login-check__box { border-color: var(--crh-primary); }
.crh-login-check input:checked + .crh-login-check__box { background: var(--crh-primary); border-color: var(--crh-primary); }
.crh-login-check input:checked + .crh-login-check__box svg { transform: scale(1); }
.crh-login-check input:active + .crh-login-check__box { transform: scale(.9); }
.crh-login-check input:focus-visible + .crh-login-check__box { box-shadow: 0 0 0 4px var(--crh-primary-ring); }

/* Submit */
.crh-login-submit {
    position: relative;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%;
    height: max(46px, calc(50 * var(--crh-fu)));
    margin-top: 4px;
    border: 0; border-radius: 11px;
    background: linear-gradient(180deg, #4b40f2, #3b2fe3);
    color: #fff;
    font-size: max(14.5px, calc(16 * var(--crh-fu)));
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(67, 56, 232, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
    transition: transform .18s var(--crh-ease), box-shadow .18s, filter .18s;
}
.crh-login-submit::after {
    content: '';
    position: absolute; inset: 0 auto 0 -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
    transform: skewX(-20deg);
    transition: transform .7s var(--crh-ease);
}
.crh-login-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(67, 56, 232, .36), inset 0 1px 0 rgba(255, 255, 255, .18); }
.crh-login-submit:hover::after { transform: translateX(430%) skewX(-20deg); }
.crh-login-submit:active { transform: translateY(0) scale(.985); }
.crh-login-submit:focus-visible { outline: 3px solid var(--crh-primary-ring); outline-offset: 3px; }
.crh-login-submit__arrow { width: 19px; height: 19px; stroke-width: 2.2; transition: transform .2s var(--crh-ease); }
.crh-login-submit:hover .crh-login-submit__arrow { transform: translateX(4px); }

.crh-login-submit__spin {
    position: absolute;
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: crh-login-spin .7s linear infinite;
}
.crh-login-submit.is-loading { pointer-events: none; filter: saturate(.9); }
.crh-login-submit.is-loading .crh-login-submit__label,
.crh-login-submit.is-loading .crh-login-submit__arrow { opacity: 0; }
.crh-login-submit.is-loading .crh-login-submit__spin { opacity: 1; }

/* Footer bits */
.crh-login-back {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: fit-content;
    margin: calc(20 * var(--crh-fu)) auto 0;
    font-size: max(13.5px, calc(15 * var(--crh-fu)));
    font-weight: 500;
    color: var(--crh-ink-2);
    text-decoration: none;
    border-radius: 4px;
    transition: color .15s;
}
.crh-login-back svg { width: 17px; height: 17px; transition: transform .2s var(--crh-ease); }
.crh-login-back:hover { color: var(--crh-primary); }
.crh-login-back:hover svg { transform: translateX(-3px); }

.crh-login-help {
    margin: calc(34 * var(--crh-fu)) 0 0;
    text-align: center;
    font-size: max(13px, calc(14.5 * var(--crh-fu)));
    color: var(--crh-ink-2);
}

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes crh-login-rise   { from { opacity: 0; transform: translateY(18px); } }
@keyframes crh-login-reveal { from { opacity: 0; translate: 0 14px; } }
@keyframes crh-login-pop    { from { opacity: 0; translate: 0 26px; scale: .92; } }
@keyframes crh-login-float  { to { translate: 0 calc(-5 * var(--u)); } }
@keyframes crh-login-grow   { from { transform: scaleY(0); } }
@keyframes crh-login-draw   { to { stroke-dashoffset: 0; } }
@keyframes crh-login-fade   { from { opacity: 0; } }
@keyframes crh-login-spin   { to { transform: rotate(360deg); } }
@keyframes crh-login-shake  { 20% { transform: translateX(-5px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet and phone: the showcase steps aside, the form takes the screen. */
@media (max-width: 999.98px) {
    :root { --crh-fu: 1px; }

    .crh-login { grid-template-columns: minmax(0, 1fr); }
    .crh-login-showcase { display: none; }
    .crh-login-card.is-compact { padding-block: 32px 28px; }

    .crh-login-panel {
        padding: 32px 16px;
        background:
            radial-gradient(60% 40% at 15% 0%, rgba(99, 91, 255, .14), transparent 70%),
            radial-gradient(55% 40% at 100% 100%, rgba(120, 160, 255, .16), transparent 70%),
            linear-gradient(160deg, #f7f7ff, #f0f1ff);
    }
    .crh-login-card { width: min(100%, 500px); padding: 36px 32px 30px; border-radius: 20px; }
}

@media (max-width: 479.98px) {
    .crh-login-panel { padding: 16px 12px; place-items: start center; }
    .crh-login-card { padding: 28px 20px 24px; border-radius: 18px; margin-block: auto; }
}

/* Pages with three fields (reset password) keep a tighter rhythm on desktop. */
@media (min-width: 1000px) {
    .crh-login-card.is-compact { padding-block: calc(34 * var(--crh-fu)) calc(28 * var(--crh-fu)); }
    .crh-login-card.is-compact .crh-login-head { margin-top: calc(24 * var(--crh-fu)); }
    .crh-login-card.is-compact .crh-login-form { gap: calc(18 * var(--crh-fu)); margin-top: calc(26 * var(--crh-fu)); }
    .crh-login-card.is-compact .crh-login-help { margin-top: calc(24 * var(--crh-fu)); }
}

/* Short laptop screens: tighten vertical rhythm so the form needs no scrolling. */
@media (min-width: 1000px) and (max-height: 700px) {
    .crh-login-panel { padding-block: 14px; }
    .crh-login-card { padding-block: 24px 20px; }
    .crh-login-head { margin-top: 14px; }
    .crh-login-form { gap: 14px; margin-top: 18px; }
    .crh-login-help { margin-top: 16px; }
}

/* Very large screens: let the stage and card keep growing in proportion. */
@media (min-width: 2200px) {
    .crh-login-panel { padding-inline: 5vw; }
}

/* ==========================================================================
   LOADER — full-screen overlay shown from the moment a form is submitted until
   the next page paints. A frosted card on a drifting brand glow: the logo in a
   disc with a comet ring and soft sonar rings, the title, a three-step list that
   ticks itself off, and a thin progress line. Only transform / opacity animate
   (plus the tiny ring), nothing blurs the page, so it stays smooth and light.
   ========================================================================== */
.crh-loader {
    --crh-orb: clamp(96px, 16vmin, 124px);
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow: hidden;
    background: linear-gradient(180deg, #f8f8ff, #f3f2fd);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility 0s .28s;
}
.crh-loader.is-open { opacity: 1; visibility: visible; transition: opacity .28s ease; }

/* the glow: three soft colour fields drifting slowly, and a faint dotted grid fading out toward the edges */
.crh-loader__aurora { position: absolute; inset: 0; pointer-events: none; }
.crh-loader__aurora i { position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%; will-change: transform; }
.crh-loader__aurora i:nth-child(1) { left: -22vmax; top: -26vmax; background: radial-gradient(closest-side, rgba(67, 56, 232, .22), transparent); animation: crh-loader-aurora-a 10s ease-in-out infinite alternate; }
.crh-loader__aurora i:nth-child(2) { right: -24vmax; bottom: -28vmax; background: radial-gradient(closest-side, rgba(236, 90, 36, .16), transparent); animation: crh-loader-aurora-b 12s ease-in-out infinite alternate; }
.crh-loader__aurora i:nth-child(3) { left: 32%; top: 42%; width: 44vmax; height: 44vmax; background: radial-gradient(closest-side, rgba(11, 169, 157, .14), transparent); animation: crh-loader-aurora-c 14s ease-in-out infinite alternate; }
.crh-loader__grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(67, 56, 232, .16) 1px, transparent 1.2px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 46% 42% at 50% 50%, #000, transparent 100%);
    mask-image: radial-gradient(ellipse 46% 42% at 50% 50%, #000, transparent 100%);
    opacity: .7;
}

.crh-loader__stage { position: relative; transform: translateY(14px) scale(.96); opacity: 0; transition: transform .6s var(--crh-ease-spring), opacity .4s ease; }
.crh-loader.is-open .crh-loader__stage { transform: none; opacity: 1; }

.crh-loader__card {
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    width: min(372px, calc(100vw - 48px));
    padding: clamp(26px, 5vmin, 38px) clamp(22px, 5vmin, 36px) clamp(24px, 4.6vmin, 32px);
    border: 1px solid rgba(67, 56, 232, .12);
    border-radius: 28px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 36px 80px -36px rgba(67, 56, 232, .38), 0 12px 30px -18px rgba(15, 19, 48, .18);
    text-align: center;
}

/* the logo: a white disc, a comet that draws a brand-coloured arc round it, sonar rings, three small satellites */
.crh-loader__orb { position: relative; display: grid; place-items: center; width: var(--crh-orb); height: var(--crh-orb); margin-bottom: clamp(20px, 4vmin, 28px); isolation: isolate; }
.crh-loader__disc { position: relative; z-index: 2; display: grid; place-items: center; width: 74%; height: 74%; border-radius: 50%; background: #fff; box-shadow: 0 14px 30px -12px rgba(67, 56, 232, .42), 0 0 0 1px rgba(67, 56, 232, .08); }
.crh-loader__mark { width: 66%; height: 66%; object-fit: contain; animation: crh-loader-breathe 2.4s cubic-bezier(.45, 0, .25, 1) infinite; }
.crh-loader__arc { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: visible; animation: crh-loader-spin 1.6s linear infinite; }
.crh-loader__arc circle { fill: none; stroke-linecap: round; }
.crh-loader__arc .is-track { stroke: rgba(67, 56, 232, .1); stroke-width: 3; }
.crh-loader__arc .is-comet { stroke: url(#crhLoaderGrad); stroke-width: 3.6; stroke-dasharray: 34 66; animation: crh-loader-comet 2.4s ease-in-out infinite; }
.crh-loader__halo { position: absolute; inset: 6%; z-index: 0; border-radius: 50%; border: 1.5px solid rgba(67, 56, 232, .38); opacity: 0; animation: crh-loader-sonar 2.6s ease-out infinite; }
.crh-loader__halo.is-2 { animation-delay: 1.3s; border-color: rgba(236, 90, 36, .3); }
.crh-loader__orbit { position: absolute; inset: -14%; z-index: 1; border-radius: 50%; animation: crh-loader-spin var(--s) linear infinite; }
.crh-loader__orbit i { position: absolute; left: 50%; top: 0; width: var(--d); height: var(--d); margin-left: calc(var(--d) / -2); border-radius: 50%; background: var(--c); box-shadow: 0 0 10px 1px var(--c); }
.crh-loader__orbit.is-1 { --s: 3s; --d: 8px; --c: #b3125f; }
.crh-loader__orbit.is-2 { --s: 4.4s; --d: 6px; --c: #f5a623; animation-direction: reverse; animation-delay: -1.4s; }
.crh-loader__orbit.is-3 { --s: 6s; --d: 5px; --c: #0ba99d; animation-delay: -3s; }

.crh-loader__title {
    margin: 0;
    font-size: clamp(22px, 3.8vmin, 28px);
    font-weight: 800;
    letter-spacing: -.03em;
    background: linear-gradient(90deg, #4338e8, #8a5cf6, #ec5a24, #4338e8);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: crh-loader-shimmer 3.4s linear infinite;
}

/* the steps: pending = hollow dot, current = small spinner, done = a tick that draws itself */
.crh-loader__steps { display: grid; gap: 11px; width: 100%; margin: 20px 0 0; padding: 0; list-style: none; text-align: left; }
.crh-loader__steps li { display: flex; align-items: center; gap: 12px; font-size: clamp(13px, 2vmin, 14.5px); font-weight: 500; color: var(--crh-faint, #98a0b8); transition: color .4s var(--crh-ease), transform .5s var(--crh-ease); }
.crh-loader__tick { position: relative; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(67, 56, 232, .18); background: #fff; transition: background .4s var(--crh-ease), border-color .4s var(--crh-ease), transform .5s var(--crh-ease-spring); }
.crh-loader__tick svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .45s var(--crh-ease) .08s; }
.crh-loader__steps li.is-active { color: var(--crh-ink, #0f1330); font-weight: 600; transform: translateX(2px); }
.crh-loader__steps li.is-active .crh-loader__tick { border-color: transparent; background: transparent; }
.crh-loader__steps li.is-active .crh-loader__tick::after { content: ""; position: absolute; inset: -1.5px; border-radius: 50%; border: 2.4px solid rgba(67, 56, 232, .16); border-top-color: var(--crh-primary, #4338e8); animation: crh-loader-spin .8s linear infinite; }
.crh-loader__steps li.is-done { color: var(--crh-muted, #6a7090); }
.crh-loader__steps li.is-done .crh-loader__tick { border-color: transparent; background: var(--crh-primary, #4338e8); transform: scale(1.04); }
.crh-loader__steps li.is-done .crh-loader__tick svg { stroke-dashoffset: 0; }

.crh-loader__bar { position: relative; display: block; width: 100%; height: 4px; margin-top: 22px; border-radius: 99px; background: rgba(67, 56, 232, .1); overflow: hidden; }
.crh-loader__bar i { position: absolute; inset: 0 auto 0 0; width: 6%; border-radius: inherit; background: linear-gradient(90deg, #4338e8, #8a5cf6, #ec5a24); animation: crh-loader-fill 14s cubic-bezier(.1, .6, .2, 1) forwards; }
.crh-loader__bar i::after { content: ""; position: absolute; inset: 0 auto 0 -40%; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent); animation: crh-loader-sheen 1.2s ease-in-out infinite; }
.crh-loader.is-done .crh-loader__bar i { animation: none; width: 100%; transition: width .3s var(--crh-ease); }

@keyframes crh-loader-aurora-a { to { transform: translate3d(14vmax, 10vmax, 0) scale(1.1); } }
@keyframes crh-loader-aurora-b { to { transform: translate3d(-12vmax, -12vmax, 0) scale(1.08); } }
@keyframes crh-loader-aurora-c { to { transform: translate3d(-10vmax, 8vmax, 0) scale(1.15); } }
@keyframes crh-loader-breathe { 0%, 100% { transform: scale(.96); } 50% { transform: scale(1.08); } }
@keyframes crh-loader-shimmer { to { background-position: -250% 0; } }
@keyframes crh-loader-fill { 0% { width: 6%; } 35% { width: 58%; } 70% { width: 82%; } 100% { width: 94%; } }
@keyframes crh-loader-sheen { to { transform: translateX(560%); } }
@keyframes crh-loader-spin { to { transform: rotate(360deg); } }
@keyframes crh-loader-comet { 0%, 100% { stroke-dasharray: 22 78; } 50% { stroke-dasharray: 46 54; } }
@keyframes crh-loader-sonar { 0% { transform: scale(.78); opacity: .55; } 100% { transform: scale(1.62); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .crh-login *, .crh-login *::before, .crh-login *::after,
    .crh-loader, .crh-loader *, .crh-loader *::before, .crh-loader *::after {
        animation: none !important;
        transition: none !important;
    }
    .crh-loader__bar i { width: 60%; }
    .crh-loader__title { background-position: 0 0; }
    .crh-loader__halo { opacity: 0; }
    .crh-loader__steps li.is-done .crh-loader__tick svg { stroke-dashoffset: 0; }
    .crh-login-bars i { transform: none; }
    .crh-login-spark__line { stroke-dashoffset: 0; }
    .crh-login-spark__area { opacity: 1; }
}
