:root {
    --bg: #05070d;
    --bg-2: #07101f;
    --panel: rgba(8, 15, 29, .9);
    --panel-strong: #0a1424;
    --line: rgba(93, 216, 255, .18);
    --line-strong: rgba(18, 199, 165, .34);
    --text: #f4f8fb;
    --muted: #a3afbd;
    --dim: #65758d;
    --blue: #3b9cff;
    --blue-2: #1d6ed3;
    --cyan: #5dd8ff;
    --teal: #12c7a5;
    --green: #28d17c;
    --amber: #f5b84d;
}

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

body {
    min-height: 100vh;
    background: var(--bg-2);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

.auth-shell {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(420px, 600px) minmax(360px, 430px);
    align-items: center;
    justify-content: center;
    gap: clamp(44px, 7vw, 132px);
    position: relative;
    overflow: hidden;
    padding: clamp(30px, 5vw, 78px);
    background:
        linear-gradient(118deg, rgba(9, 20, 37, .98) 0%, rgba(6, 10, 19, .98) 54%, #05070d 100%);
}

.auth-shell::before,
.auth-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-shell::before {
    background-image:
        linear-gradient(rgba(93, 216, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(93, 216, 255, .045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .62) 44%, transparent 82%);
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .62) 44%, transparent 82%);
    opacity: .9;
}

.auth-shell::after {
    background:
        linear-gradient(132deg, rgba(18, 199, 165, .17) 0%, transparent 27%),
        linear-gradient(315deg, rgba(59, 156, 255, .16) 0%, transparent 32%);
}

.auth-left {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 600px;
}

.auth-logo {
    width: min(286px, 78vw);
    height: auto;
    display: block;
    margin-bottom: 34px;
    filter: drop-shadow(0 22px 34px rgba(0, 0, 0, .32));
}

.brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    background: rgba(10, 20, 36, .72);
    border: 1px solid rgba(93, 216, 255, .24);
    border-radius: 999px;
    padding: 7px 14px;
    margin-bottom: 24px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.brand-chip i,
.brand-chip .svg-inline--fa,
.brand-chip span {
    color: var(--cyan);
}

.brand-chip span {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 800;
}

.auth-left h1 {
    max-width: 560px;
    font-size: clamp(40px, 5vw, 70px);
    line-height: .98;
    letter-spacing: 0;
    font-weight: 850;
    margin-bottom: 20px;
}

.auth-left h1 em {
    font-style: normal;
    color: var(--cyan);
}

.auth-left p {
    max-width: 470px;
    color: var(--muted);
    line-height: 1.75;
    font-size: 15px;
}

.auth-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    gap: 18px;
    max-width: 440px;
    margin-top: 34px;
}

.auth-stats div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 14px;
    border-top: 1px solid rgba(93, 216, 255, .2);
}

.auth-stats strong {
    font-size: 24px;
    color: #ffffff;
}

.auth-stats span {
    color: var(--muted);
    font-size: 11px;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card-inner {
    width: 100%;
    position: relative;
    padding: 34px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(16, 31, 55, .74), rgba(8, 15, 29, .94)),
        var(--panel);
    backdrop-filter: blur(22px);
    box-shadow: 0 26px 78px rgba(0, 0, 0, .34);
}

.auth-card-inner::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(90deg, var(--teal), var(--cyan), var(--blue));
}

.form-header {
    margin-bottom: 28px;
}

.form-header.centered {
    text-align: center;
}

.form-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0;
}

.form-header p {
    color: var(--muted);
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.field-group {
    margin-bottom: 17px;
}

.field-group label {
    display: block;
    color: #c1cbd8;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 7px;
}

.field-wrap {
    position: relative;
}

.field-wrap > i:first-child,
.field-wrap > .svg-inline--fa:first-child {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8da1;
    font-size: 14px;
    width: 15px;
    z-index: 1;
    pointer-events: none;
    transition: color .18s ease;
}

.field-wrap input {
    width: 100%;
    min-height: 48px;
    padding: 12px 44px 12px 42px;
    border-radius: 8px;
    border: 1px solid rgba(93, 216, 255, .18);
    background: rgba(5, 9, 18, .78);
    color: var(--text);
    outline: none;
    font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field-wrap input:focus {
    border-color: rgba(93, 216, 255, .72);
    background: rgba(5, 9, 18, .96);
    box-shadow: 0 0 0 3px rgba(93, 216, 255, .09);
}

.field-wrap:focus-within > i:first-child,
.field-wrap:focus-within > .svg-inline--fa:first-child {
    color: var(--cyan);
}

.field-wrap input::placeholder {
    color: var(--dim);
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: #7f8da1;
    cursor: pointer;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--cyan);
}

.btn-main,
.btn-ghost {
    min-height: 46px;
    width: 100%;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
}

.btn-main {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-2), var(--blue) 55%, var(--teal));
    box-shadow: 0 16px 30px rgba(29, 110, 211, .22);
}

.btn-main:hover,
.btn-ghost:hover {
    transform: translateY(-1px);
}

.btn-ghost {
    border: 1px solid rgba(93, 216, 255, .28);
    color: var(--cyan);
    background: rgba(7, 16, 31, .58);
}

.btn-ghost:hover {
    border-color: rgba(18, 199, 165, .55);
    background: rgba(18, 199, 165, .08);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
}

.auth-links.centered {
    justify-content: center;
}

.auth-links a {
    color: var(--cyan);
    text-decoration: none;
    font-size: 12px;
    font-weight: 650;
}

.auth-links a:hover {
    color: var(--teal);
}

.auth-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.auth-separator::before,
.auth-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(93, 216, 255, .16);
}

.auth-separator span {
    color: var(--muted);
    font-size: 11px;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 30px;
    max-width: 420px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    opacity: .55;
}

.step-item.active {
    opacity: 1;
    color: #dbeafe;
}

.step-item span {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(18, 199, 165, .12);
    border: 1px solid rgba(18, 199, 165, .28);
    color: var(--cyan);
    font-weight: 800;
}

.forgot-step {
    display: none;
}

.forgot-step.active {
    display: block;
}

.otp-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 16px 0;
}

.otp-row input {
    width: 44px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid rgba(93, 216, 255, .25);
    background: rgba(5, 9, 18, .78);
    color: var(--cyan);
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    outline: none;
}

.success-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border: 2px solid var(--green);
    color: var(--green);
    font-size: 28px;
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: minmax(0, 640px);
        gap: 30px;
        align-content: start;
    }

    .auth-left {
        padding-top: 6px;
    }

    .auth-left h1 {
        font-size: 42px;
    }

    .auth-card {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 560px) {
    .auth-shell {
        padding: 24px 16px 30px;
    }

    .auth-logo {
        width: min(246px, 84vw);
        margin-bottom: 24px;
    }

    .brand-chip {
        max-width: 100%;
    }

    .brand-chip span {
        white-space: normal;
    }

    .auth-left h1 {
        font-size: 36px;
    }

    .auth-left p {
        font-size: 14px;
    }

    .auth-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .auth-stats strong {
        font-size: 18px;
    }

    .auth-card-inner {
        padding: 28px 20px;
    }

    .auth-links {
        gap: 12px;
        flex-wrap: wrap;
    }

    .otp-row {
        gap: 6px;
    }

    .otp-row input {
        width: 40px;
        height: 46px;
    }
}

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