/* Shared auth recovery pages — matches Orivex login */
:root {
    --ink: #0f172a;
    --ink-soft: #1e293b;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --field: #f8fafc;
    --field-hover: #f1f5f9;
    --brand: #ea580c;
    --brand-hover: #f97316;
    --brand-dark: #c2410c;
    --brand-soft: rgba(234, 88, 12, 0.08);
    --brand-ring: rgba(234, 88, 12, 0.18);
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --danger-line: #fecaca;
    --success: #059669;
    --success-soft: #ecfdf5;
    --page: #ffffff;
    --radius: 12px;
    --radius-sm: 10px;
    --shadow-btn: 0 14px 32px rgba(234, 88, 12, 0.22);
    --shadow-focus: 0 0 0 4px var(--brand-ring);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --space-xs: clamp(4px, 0.6vh, 8px);
    --space-sm: clamp(8px, 1.1vh, 12px);
    --space-md: clamp(12px, 1.6vh, 18px);
    --space-lg: clamp(16px, 2.2vh, 28px);
    --input-h: clamp(44px, 5.2vh, 50px);
    --btn-h: clamp(46px, 5.4vh, 52px);
}

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

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

.material-symbols-rounded {
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
    font-size: 20px;
    line-height: 1;
    user-select: none;
}

a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-page {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-columns: minmax(340px, 42%) 1fr;
    min-height: 0;
}

.auth-side {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 2.5vh, 36px) clamp(20px, 3.5vw, 56px);
    background: var(--page);
    overflow-y: auto;
}

.auth-content {
    width: min(400px, 100%);
    margin: auto 0;
    animation: rise-in 0.5s var(--ease) both;
}

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

.logo {
    width: min(170px, 60%);
    height: auto;
    display: block;
    margin-bottom: var(--space-lg);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: var(--space-md);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover {
    color: var(--brand);
    text-decoration: none;
}

.back-link .material-symbols-rounded {
    font-size: 18px;
}

/* Steps */
.steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: var(--space-lg);
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: var(--page);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--muted-2);
    white-space: nowrap;
}

.step.is-active .step-num {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.step.is-active .step-label {
    color: var(--brand);
}

.step.is-done .step-num {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand);
}

.step.is-done .step-label {
    color: var(--ink-soft);
}

.step-line {
    flex: 1;
    height: 2px;
    margin: 0 8px;
    background: var(--line);
    min-width: 12px;
    border-radius: 999px;
}

.step-line.is-done {
    background: rgba(234, 88, 12, 0.35);
}

.icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    margin-bottom: var(--space-sm);
}

.icon-badge .material-symbols-rounded {
    font-size: 26px;
}

.icon-badge.success {
    background: var(--success-soft);
    color: var(--success);
}

h1 {
    margin: 0;
    font-size: clamp(1.45rem, 2vw + 0.4vh, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
    color: var(--ink);
}

.intro {
    margin: var(--space-xs) 0 var(--space-md);
    color: var(--muted);
    font-size: clamp(13px, 1.4vh, 15px);
    line-height: 1.55;
    font-weight: 500;
}

.intro strong {
    color: var(--ink-soft);
    font-weight: 700;
}

.field {
    margin-bottom: var(--space-sm);
}

.field-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

label {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

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

.input-wrap {
    position: relative;
}

.input-wrap > .leading-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-2);
    pointer-events: none;
    z-index: 1;
}

.input-wrap:focus-within > .leading-icon {
    color: var(--brand);
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    height: var(--input-h);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--field);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 550;
    outline: none;
    padding: 0 46px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder {
    color: var(--muted-2);
    font-weight: 500;
}

input:hover {
    background: var(--field-hover);
    border-color: var(--line-strong);
}

input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: var(--shadow-focus);
}

.field.has-error input {
    border-color: var(--danger);
    background: var(--danger-soft);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.field.has-error .leading-icon {
    color: var(--danger);
}

.field-error {
    display: none;
    margin-top: 6px;
    color: var(--danger);
    font-size: 12.5px;
    font-weight: 600;
    align-items: center;
    gap: 4px;
}

.field.has-error .field-error {
    display: flex;
}

.toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted-2);
    cursor: pointer;
}

.toggle:hover {
    color: var(--ink-soft);
    background: rgba(15, 23, 42, 0.05);
}

/* OTP boxes */
.otp-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin: var(--space-md) 0 var(--space-sm);
}

.otp-row input {
    width: 100%;
    max-width: 54px;
    height: 56px;
    padding: 0;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    border-radius: 12px;
}

.otp-row.has-error input {
    border-color: var(--danger);
    background: var(--danger-soft);
}

.resend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.resend-row button {
    border: 0;
    background: none;
    color: var(--brand);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.resend-row button:disabled {
    color: var(--muted-2);
    cursor: not-allowed;
}

.resend-row button:not(:disabled):hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Password strength */
.strength {
    margin-top: 8px;
    display: none;
}

.strength.is-visible {
    display: block;
}

.strength-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.strength-bars span {
    height: 4px;
    border-radius: 999px;
    background: var(--line);
}

.strength-bars[data-level="1"] span:nth-child(-n+1) { background: #ef4444; }
.strength-bars[data-level="2"] span:nth-child(-n+2) { background: #f59e0b; }
.strength-bars[data-level="3"] span:nth-child(-n+3) { background: #f97316; }
.strength-bars[data-level="4"] span:nth-child(-n+4) { background: #059669; }

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

.rules {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rules li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}

.rules li .material-symbols-rounded {
    font-size: 16px;
    color: var(--muted-2);
}

.rules li.is-met {
    color: var(--success);
}

.rules li.is-met .material-symbols-rounded {
    color: var(--success);
}

/* Buttons & alerts */
.btn {
    position: relative;
    width: 100%;
    height: var(--btn-h);
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s var(--ease), filter 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
    background: linear-gradient(180deg, var(--brand-hover) 0%, var(--brand) 100%);
    color: #fff;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--page);
    color: var(--ink-soft);
    border: 1.5px solid var(--line);
    box-shadow: none;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: var(--field);
}

.btn .spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

.btn.is-loading .spinner {
    display: block;
}

.btn.is-loading .btn-label {
    display: none;
}

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

.form-alert {
    display: none;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: var(--space-sm);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--danger-line);
    background: var(--danger-soft);
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.form-alert.is-visible {
    display: flex;
}

.form-alert.is-success {
    border-color: #a7f3d0;
    background: var(--success-soft);
    color: #065f46;
}

.form-alert .material-symbols-rounded {
    flex-shrink: 0;
    color: var(--danger);
}

.form-alert.is-success .material-symbols-rounded {
    color: var(--success);
}

.footer-note {
    margin-top: var(--space-md);
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.demo-hint {
    margin-top: var(--space-md);
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fafbfc, #f8fafc);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.5;
    font-weight: 500;
}

.demo-hint strong {
    color: var(--ink-soft);
    font-weight: 700;
}

.demo-hint code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-soft);
    padding: 1px 6px;
    border-radius: 5px;
}

/* Success state */
.success-panel {
    text-align: center;
}

.success-panel .icon-badge {
    margin-left: auto;
    margin-right: auto;
}

.success-panel h1 {
    margin-bottom: 8px;
}

/* Visual side */
.visual-side {
    position: relative;
    height: 100%;
    overflow: hidden;
    background: #0b1220;
}

.visual-bg {
    position: absolute;
    inset: 0;
    background: url("../img/loginpagef.webp") center / cover no-repeat;
}

.visual-copy {
    position: absolute;
    left: clamp(24px, 4vw, 48px);
    right: clamp(24px, 4vw, 48px);
    bottom: clamp(28px, 5vh, 52px);
    z-index: 1;
    color: #fff;
}

.visual-copy .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 5px 12px 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.visual-copy .eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fdba74;
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.25);
}

.visual-copy h2 {
    margin: 0 0 10px;
    font-size: clamp(1.4rem, 1.5vw + 1vh, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    max-width: 480px;
}

.visual-copy p {
    margin: 0;
    max-width: 420px;
    font-size: clamp(0.9rem, 0.8vw + 0.5vh, 1.05rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 500;
}

@media (max-width: 900px) {
    body {
        overflow: auto;
        height: auto;
    }

    .auth-page {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        grid-template-columns: 1fr;
    }

    .auth-side {
        order: 2;
        height: auto;
        padding: 36px 24px 48px;
        overflow: visible;
    }

    .visual-side {
        order: 1;
        height: min(32vh, 280px);
        min-height: 200px;
    }

    .visual-copy h2 {
        font-size: 1.35rem;
    }

    .step-label {
        display: none;
    }
}

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

    .otp-row input {
        max-width: none;
        height: 48px;
        font-size: 18px;
    }
}

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