/*
	===============================
		Auth pages
	===============================
    Split-screen layout for sign in, 2FA and password reset
    (admin/layouts/auth + admin/pages/auth/*). Navy + blue theme.
*/

:root {
    --auth-navy: #0f172a;
    --auth-accent: #3b82f6;
    --auth-accent-dark: #2563eb;
    --auth-accent-rgb: 59, 130, 246;
    --auth-ink: #0f172a;
    --auth-text: #334155;
    --auth-muted: #64748b;
    --auth-faint: #94a3b8;
    --auth-border: #cbd5e1;
    --auth-line: #e2e8f0;
    --auth-bg: #f4f6fa;
}

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

html,
body {
    height: 100%;
}

body.auth-body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
    font-size: 14px;
    color: var(--auth-text);
    background: var(--auth-bg);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

/*
	===============================
		Brand panel
	===============================
*/
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 56px;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.35) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(96, 165, 250, 0.28) 0%, transparent 50%),
        linear-gradient(140deg, #0b1222 0%, #0f172a 40%, #1e3a8a 100%);
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
    pointer-events: none;
}

.auth-brand > * {
    position: relative;
    z-index: 1;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    text-decoration: none;
}

.auth-logo-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
}

.auth-logo-tile img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.auth-logo span {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-brand-copy h1 {
    max-width: 460px;
    margin: 0 0 14px;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.auth-brand-copy h1 em {
    font-style: normal;
    background: linear-gradient(90deg, #93c5fd 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-brand-copy > p {
    max-width: 420px;
    margin: 0 0 30px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.72);
}

.auth-features {
    display: grid;
    gap: 12px;
    max-width: 420px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.auth-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(var(--auth-accent-rgb), 0.25);
    color: #bfdbfe;
}

.auth-feature-icon svg {
    width: 18px;
    height: 18px;
}

.auth-features b {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
}

.auth-features span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.62);
}

.auth-brand-foot {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/*
	===============================
		Form side
	===============================
*/
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-mobile-logo {
    display: none;
    margin-bottom: 22px;
}

.auth-mobile-logo .auth-logo span {
    color: var(--auth-ink);
}

.auth-mobile-logo .auth-logo-tile {
    background: var(--auth-navy);
    border-color: var(--auth-navy);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 34px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid var(--auth-line);
    box-shadow: 0 30px 60px -30px rgba(15, 23, 42, 0.25);
    animation: auth-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes auth-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.auth-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border-radius: 15px;
    color: var(--auth-accent-dark);
    background: #eff6ff;
}

.auth-card-icon svg {
    width: 24px;
    height: 24px;
}

.auth-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--auth-accent-dark);
}

.auth-step-dots {
    display: inline-flex;
    gap: 4px;
}

.auth-step-dots i {
    width: 18px;
    height: 4px;
    border-radius: 999px;
    background: var(--auth-line);
}

.auth-step-dots i.is-done {
    background: var(--auth-accent);
}

.auth-card h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--auth-ink);
}

.auth-card .auth-sub {
    margin: 0 0 24px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--auth-muted);
}

.auth-sub b {
    color: var(--auth-ink);
}

/* Alerts */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    border: 1px solid;
}

.auth-alert svg {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin-top: 1px;
}

.auth-alert.is-success {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.auth-alert.is-error {
    color: #be123c;
    background: #fff1f2;
    border-color: #fecdd3;
}

/* Fields */
.auth-field {
    margin-bottom: 18px;
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.auth-field label {
    font-size: 12.5px;
    font-weight: 700;
    color: #475569;
}

.auth-link {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--auth-accent-dark);
    text-decoration: none;
}

.auth-link:hover {
    color: var(--auth-navy);
    text-decoration: underline;
}

.auth-input {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input > svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--auth-faint);
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-input input {
    width: 100%;
    height: 48px;
    padding: 0 46px 0 44px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--auth-ink);
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input input::placeholder {
    color: var(--auth-faint);
}

.auth-input input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px rgba(var(--auth-accent-rgb), 0.15);
}

.auth-input:focus-within > svg {
    color: var(--auth-accent-dark);
}

.auth-input.is-invalid input {
    border-color: #fb7185;
}

.auth-toggle {
    position: absolute;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 9px;
    color: var(--auth-faint);
    background: transparent;
    cursor: pointer;
}

.auth-toggle:hover {
    color: var(--auth-ink);
    background: #f1f5f9;
}

.auth-toggle svg {
    width: 18px;
    height: 18px;
}

.auth-toggle .is-hide,
.auth-toggle.is-visible .is-show {
    display: none;
}

.auth-toggle.is-visible .is-hide {
    display: block;
}

.auth-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #e11d48;
}

.auth-error:empty {
    display: none;
}

/* Code inputs */
.auth-code {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 6px 0 22px;
}

.auth-code input {
    width: 60px;
    height: 64px;
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    font-family: inherit;
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    color: var(--auth-ink);
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-code input:focus {
    outline: none;
    border-color: var(--auth-accent);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(var(--auth-accent-rgb), 0.15);
}

.auth-code input.is-filled {
    border-color: var(--auth-accent);
    background: #ffffff;
}

.auth-input input.auth-otp-single {
    padding-right: 16px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5em;
}

/* Buttons */
.auth-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 14px 28px -14px rgba(37, 99, 235, 0.9);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 18px 32px -14px rgba(37, 99, 235, 0.95);
}

.auth-btn svg {
    width: 18px;
    height: 18px;
}

.auth-btn:disabled {
    cursor: wait;
    opacity: 0.85;
    transform: none;
}

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

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

.auth-btn.is-loading .auth-btn-icon {
    display: none;
}

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

.auth-foot {
    margin: 22px 0 0;
    font-size: 13px;
    text-align: center;
    color: var(--auth-muted);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-back svg {
    width: 15px;
    height: 15px;
}

.auth-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
    font-size: 11.5px;
    color: var(--auth-faint);
}

.auth-secure svg {
    width: 13px;
    height: 13px;
}

/*
	===============================
		Responsive
	===============================
*/
@media (max-width: 1199px) {
    .auth-brand {
        padding: 36px 40px;
    }

    .auth-brand-copy h1 {
        font-size: 30px;
    }
}

@media (max-width: 991px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-brand {
        display: none;
    }

    .auth-main {
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 32px 20px;
        background:
            radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
            radial-gradient(circle at 100% 100%, rgba(30, 58, 138, 0.1) 0%, transparent 45%),
            var(--auth-bg);
    }

    .auth-mobile-logo {
        display: block;
        margin-top: auto;
        margin-bottom: 22px;
    }

    .auth-secure {
        margin-top: 22px;
        margin-bottom: auto;
    }
}

@media (max-width: 480px) {
    .auth-main {
        padding: 24px 14px;
    }

    .auth-mobile-logo {
        margin-bottom: 18px;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 18px;
    }

    .auth-card h2 {
        font-size: 21px;
    }

    .auth-code {
        gap: 8px;
    }

    .auth-code input {
        width: 54px;
        height: 58px;
    }

    .auth-secure {
        margin-top: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none;
    }
}
