/* Auth pages — aligned with dashboard navy / orange fintech theme */
:root {
    --ua-bg: #eef6fc;
    --ua-bg-soft: #dceef8;
    --ua-card: #ffffff;
    --ua-navy: #1e3a5f;
    --ua-navy-deep: #152a45;
    --ua-orange: #ff8c00;
    --ua-orange-gold: #ffb347;
    --ua-grad: linear-gradient(90deg, #ff8c00 0%, #ffb347 100%);
    --ua-grad-navy: linear-gradient(145deg, #2a4a73 0%, #1e3a5f 55%, #152a45 100%);
    --ua-text: #1a2b4a;
    --ua-text-muted: #64748b;
    --ua-border: rgba(30, 58, 95, 0.12);
    --ua-shadow: 0 12px 32px rgba(30, 58, 95, 0.1);
    --ua-shadow-lg: 0 20px 48px rgba(30, 58, 95, 0.16);
    --ua-radius: 18px;
    --ua-radius-lg: 22px;
}

html:has(.ua-screen--login),
html:has(.ua-screen--register),
body:has(.ua-screen--login),
body:has(.ua-screen--register) {
    background: var(--ua-bg) !important;
    background-image: linear-gradient(180deg, #f4f9fd 0%, #eef6fc 100%) !important;
    background-attachment: fixed;
}

.ua-screen--login,
.ua-screen--register {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ua-text);
}

.ua-sheet--login,
.ua-sheet--register {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

/* Back */
.ua-auth-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--ua-card);
    border: 1px solid var(--ua-border);
    color: var(--ua-navy);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.08);
    transition: background .2s, transform .2s, box-shadow .2s;
}

.ua-auth-back:hover {
    background: #fff;
    color: var(--ua-navy);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 58, 95, 0.12);
}

/* Logo only */
.ua-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 4px;
}

.ua-brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.ua-brand-logo {
    width: auto;
    height: 52px;
    max-width: min(200px, 70vw);
    object-fit: contain;
    display: block;
}

/* Form card */
.ua-form-card {
    background: var(--ua-card);
    border-radius: var(--ua-radius-lg);
    border: 1px solid var(--ua-border);
    box-shadow: var(--ua-shadow);
    padding: 22px 20px 20px;
}

.ua-auth-ref {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin-bottom: 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 140, 0, 0.25);
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    font-size: 12px;
    font-weight: 600;
    color: var(--ua-navy);
}

.ua-auth-ref i {
    color: var(--ua-orange);
}

.ua-auth-ref b {
    font-weight: 800;
    color: var(--ua-orange-dark, #e67e00);
}

.ua-auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ua-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ua-auth-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ua-text);
}

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

.ua-auth-input {
    width: 100%;
    min-height: 48px;
    border: 1.5px solid var(--ua-border);
    border-radius: 14px;
    background: var(--ua-bg-soft);
    padding: 12px 16px;
    color: var(--ua-text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.ua-auth-input-wrap .ua-auth-input {
    padding-right: 46px;
}

.ua-auth-input::placeholder {
    color: #94a3b8;
}

.ua-auth-input:focus {
    border-color: var(--ua-orange);
    box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.18);
    background: #fff;
}

.ua-auth-input:-webkit-autofill,
.ua-auth-input:-webkit-autofill:hover,
.ua-auth-input:-webkit-autofill:focus,
.ua-auth-input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--ua-text) !important;
    caret-color: var(--ua-text);
    box-shadow: 0 0 0 1000px var(--ua-bg-soft) inset !important;
    -webkit-box-shadow: 0 0 0 1000px var(--ua-bg-soft) inset !important;
    transition: background-color 9999s ease-out 0s;
}

.ua-auth-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: transparent;
    color: var(--ua-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    pointer-events: auto;
    transition: color .2s, background .2s;
}

.ua-auth-eye:hover {
    color: var(--ua-navy);
    background: rgba(30, 58, 95, 0.06);
}

.ua-auth-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: -2px;
}

.ua-login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--ua-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ua-login-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--ua-orange);
    cursor: pointer;
}

.ua-login-forgot {
    color: var(--ua-orange);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.ua-login-forgot:hover {
    color: var(--ua-orange-dark, #e67e00);
    text-decoration: underline;
}

.ua-auth-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 6px;
    border: 0;
    border-radius: 999px;
    background: var(--ua-grad);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: .01em;
    box-shadow: 0 8px 22px rgba(255, 140, 0, 0.32);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
}

.ua-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 140, 0, 0.4);
}

.ua-auth-submit:active {
    transform: translateY(0);
}

.ua-auth-submit i {
    font-size: 14px;
    opacity: .95;
}

.ua-auth-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--ua-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    text-align: center;
}

.ua-auth-footer-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--ua-text-muted);
}

.ua-auth-link {
    color: var(--ua-orange);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.ua-auth-link:hover {
    color: var(--ua-orange-dark, #e67e00);
    text-decoration: underline;
}

.ua-auth-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ua-text-muted);
}

.ua-auth-trust i {
    color: var(--ua-orange);
    font-size: 12px;
}

@media (max-width: 380px) {
    .ua-form-card {
        padding: 18px 16px 16px;
    }

    .ua-brand-logo {
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ua-auth-submit,
    .ua-auth-back,
    .ua-auth-input {
        transition-duration: .01ms !important;
    }
}
