/* ===================== Auth pages ===================== */
.auth {
    --auth-primary: #0869f5;
    --auth-primary-dark: #0552c4;
    --auth-primary-soft: #eef5ff;
    --auth-text: #202b3c;
    --auth-muted: #7d8798;
    --auth-border: #dfe6ef;
    --auth-red: #e5484d;
    --auth-green: #12a26b;

    position: relative;
    overflow: hidden;
    padding: 48px 16px 80px;
    background:
        radial-gradient(circle at 12% 18%, rgba(8, 105, 245, .08) 0, transparent 38%),
        radial-gradient(circle at 88% 85%, rgba(79, 155, 255, .10) 0, transparent 40%),
        #f4f7fb;
    color: var(--auth-text);
    font-size: 13px;
}
.auth *, .auth *:before, .auth *:after { box-sizing: border-box; }

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    max-width: 980px;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e3eaf3;
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(20, 54, 110, .12);
}
.auth-shell.is-narrow { max-width: 520px; grid-template-columns: minmax(0, 1fr); }
.auth-shell.is-narrow .auth-brand { display: none; }

/* ---------- Brand side ---------- */
.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 40px 36px;
    color: #fff;
    background: linear-gradient(150deg, #0552c4 0%, #0869f5 50%, #4f9bff 100%);
}
.auth-brand:before, .auth-brand:after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .09);
}
.auth-brand:before { width: 320px; height: 320px; top: -140px; left: -120px; }
.auth-brand:after { width: 240px; height: 240px; bottom: -110px; right: -80px; }
.auth-brand > * { position: relative; z-index: 1; }

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 10px 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 30, 90, .18);
}
.auth-logo img { max-height: 42px; width: auto; }

.auth-brand h2 { margin: 34px 0 10px; font-size: 22px; font-weight: 900; line-height: 1.7; color: #fff; }
.auth-brand > p { margin: 0 !important; opacity: .88; line-height: 2.1; }

.auth-perks { list-style: none; margin: 28px 0 0 !important; padding: 0; display: grid; gap: 12px; }
.auth-perks li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(4px);
    font-weight: 600;
}
.auth-perk-icon {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .2);
    font-size: 15px;
}
.auth-perk-icon img { width: 20px; height: 20px; object-fit: contain; }
.auth-perks a { color: #fff !important; }
.auth-perks a:hover { text-decoration: underline !important; }
.auth-brand-foot { margin-top: auto; padding-top: 30px; font-size: 11px; opacity: .75; }

/* ---------- Form side ---------- */
.auth-panel { padding: 40px 40px 32px; display: flex; flex-direction: column; }

.auth-mobile-logo { display: none; text-align: center; margin-bottom: 18px; }
.auth-mobile-logo img { max-height: 44px; width: auto; }

.auth-head { margin-bottom: 26px; }
.auth-head-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    border-radius: 17px;
    background: linear-gradient(135deg, #0869f5, #4b97ff);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 12px 24px rgba(8, 105, 245, .28);
}
.auth-head h1 { margin: 0 0 6px; font-size: 21px; font-weight: 900; color: var(--auth-text); }
.auth-head p { margin: 0 !important; color: var(--auth-muted); line-height: 2; }

/* ---------- Steps ---------- */
.auth-steps { display: flex; align-items: flex-start; margin-bottom: 26px; }
.auth-step { flex: 1; position: relative; text-align: center; color: #a3acba; font-size: 11px; font-weight: 700; }
.auth-step span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: #eef1f6;
    color: #8a94a6;
    font-size: 13px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #e3eaf3;
    transition: background .3s, color .3s;
}
.auth-step:not(:first-child):before {
    content: "";
    position: absolute;
    top: 17px;
    right: -50%;
    left: 50%;
    height: 3px;
    background: #eef1f6;
}
.auth-step.is-active, .auth-step.is-done { color: var(--auth-primary); }
.auth-step.is-active span { background: var(--auth-primary); color: #fff; box-shadow: 0 0 0 4px rgba(8, 105, 245, .15); }
.auth-step.is-done span { background: var(--auth-primary-soft); color: var(--auth-primary); box-shadow: 0 0 0 1px #b9d3fb; }
.auth-step.is-done:before, .auth-step.is-active:before { background: var(--auth-primary); }

/* ---------- Fields ---------- */
.auth-field { margin-bottom: 16px; }
.auth-field > label, .auth label.auth-label {
    display: block;
    margin-bottom: 7px;
    color: #4d5a6e;
    font-size: 12px;
    font-weight: 700;
}
.auth-input { position: relative; }
.auth-input > i:first-child {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: #a3acba;
    font-size: 15px;
    pointer-events: none;
    transition: color .2s;
}
.auth-input:focus-within > i:first-child { color: var(--auth-primary); }
.auth .form-control {
    min-height: 48px;
    padding: 10px 44px 10px 14px;
    border: 1px solid var(--auth-border);
    border-radius: 13px;
    background: #fbfcfe;
    color: var(--auth-text);
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth .form-control:focus {
    border-color: #7fb0fb;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8, 105, 245, .1);
}
.auth .form-control.is-invalid { border-color: var(--auth-red); background-image: none; }
.auth .form-control[dir="ltr"] { text-align: left; }
.auth .form-control[dir="ltr"]::placeholder { text-align: right; }
.auth-input.has-toggle .form-control { padding-left: 46px; }
.auth-toggle-pass {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #8a94a6;
    cursor: pointer;
}
.auth-toggle-pass:hover { background: #f1f4f9; color: var(--auth-primary); }

.auth-error { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--auth-red); font-size: 11.5px; font-weight: 600; }

.auth-code.form-control {
    padding: 10px 14px;
    text-align: center !important;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 10px;
    min-height: 58px;
}

.auth-otp { display: flex; gap: 8px; }
.auth-otp .auth-input { flex: 1; }
.auth-otp .btn { flex-shrink: 0; }

/* ---------- Segmented toggle ---------- */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: #f1f4f9;
}
.auth-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.auth-tabs label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    padding: 9px 8px;
    border-radius: 11px;
    color: #6b7789;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s, box-shadow .2s;
}
.auth-tabs input:checked + label { background: #fff; color: var(--auth-primary); box-shadow: 0 4px 12px rgba(20, 54, 110, .1); }

/* ---------- Buttons ---------- */
.auth .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 13px;
    font-weight: 800;
    font-size: 13px;
    padding: 10px 18px;
    transition: transform .15s, box-shadow .2s, background .2s;
}
.auth .btn:active { transform: scale(.98); }
.auth .btn-primary {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
    box-shadow: 0 10px 20px rgba(8, 105, 245, .25);
}
.auth .btn-primary:hover { background: var(--auth-primary-dark); border-color: var(--auth-primary-dark); }
.auth .btn-soft { background: var(--auth-primary-soft); border: 1px solid transparent; color: var(--auth-primary); }
.auth .btn-soft:hover { background: #dcebff; color: var(--auth-primary-dark); }
.auth .btn-light { background: #f1f4f9; border-color: #f1f4f9; color: #4d5a6e; }
.auth .btn-light:hover { background: #e6ebf3; }
.auth-submit { width: 100%; min-height: 50px; font-size: 14px !important; }
.auth .btn[disabled] { opacity: .65; }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 20px; }
.auth-link { color: var(--auth-primary) !important; font-weight: 700; font-size: 12px; }
.auth-link:hover { color: var(--auth-primary-dark) !important; text-decoration: underline !important; }
.auth-link-muted { color: var(--auth-muted) !important; font-weight: 600; font-size: 12px; }
.auth-link-muted:hover { color: var(--auth-primary) !important; }

.auth .form-check { display: flex; align-items: center; gap: 8px; padding: 0; margin: 0; }
.auth .form-check-input { float: none; margin: 0; width: 18px; height: 18px; border-radius: 6px; border-color: #c9d3e0; cursor: pointer; }
.auth .form-check-input:checked { background-color: var(--auth-primary); border-color: var(--auth-primary); }
.auth .form-check-label { margin: 0; color: #4d5a6e; font-size: 12px; font-weight: 600; cursor: pointer; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: #a3acba; font-size: 11px; }
.auth-divider:before, .auth-divider:after { content: ""; flex: 1; height: 1px; background: #e8edf4; }

.auth-foot { margin-top: auto; padding-top: 22px; text-align: center; color: var(--auth-muted); font-size: 12.5px; }

/* ---------- Alerts ---------- */
.auth .alert { border: 0; border-radius: 13px; font-size: 12.5px; padding: 12px 16px; }
.auth .alert ul { margin: 0; padding-right: 18px; }
.auth .alert-danger { background: #fdecec; color: #b42328; }
.auth .alert-success { background: #e7f8f0; color: #0d7a50; }
.auth-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 13px;
    background: var(--auth-primary-soft);
    color: #2d5ea8;
    font-size: 12px;
    line-height: 2;
}
.auth-note > i { margin-top: 5px; }
.auth-note b { color: var(--auth-text); }

.auth-hint { color: var(--auth-muted); font-size: 11.5px; margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
    .auth-brand { display: none; }
    .auth-mobile-logo { display: block; }
}

@media (max-width: 575.98px) {
    .auth { padding: 20px 12px 50px; }
    .auth-shell { border-radius: 20px; }
    .auth-panel { padding: 26px 20px 22px; }
    .auth-head h1 { font-size: 18px; }
    .auth-head-icon { width: 48px; height: 48px; font-size: 19px; border-radius: 15px; }
    .auth-code.form-control { font-size: 20px; letter-spacing: 6px; }
}
