/* Admin auth pages (Login, Forgot Password): clean modern fintech theme */
:root {
    --auth-primary: #0a3fa8;
    --auth-primary-dark: #082f7f;
    --auth-accent: #0f5bd8;
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-line: #e2e8f0;
    --auth-field: #f8fafc;
    --auth-danger: #dc2626;
    --auth-success: #2fa62a;
    --auth-radius: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-x: hidden;
    color: var(--auth-ink);
    background: #eef2f9;
}

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(900px 500px at 10% 0%, rgba(15, 91, 216, 0.14), transparent 60%),
        radial-gradient(800px 500px at 100% 100%, rgba(27, 58, 138, 0.16), transparent 60%),
        #eef2f9;
}

/* Shell */
.auth-shell {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.auth-shell--narrow { max-width: 460px; min-height: 0; display: block; }
.card-header-gradient {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--auth-primary), var(--auth-accent));
    z-index: 2;
}

/* Brand panel */
.brand-panel {
    position: relative;
    background:
        radial-gradient(circle at 15% 15%, rgba(96, 165, 250, 0.35) 0, transparent 45%),
        linear-gradient(155deg, var(--auth-primary-dark) 0%, var(--auth-primary) 60%, var(--auth-accent) 130%);
    color: #fff;
    padding: 3rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(ellipse at top left, black, transparent 70%);
    pointer-events: none;
}
.brand-mark { display: flex; align-items: center; gap: 0.75rem; position: relative; z-index: 1; }
.brand-mark img { height: 34px; width: auto; object-fit: contain; }
/* The logo is a coloured image with a light background, so it sits on a white badge
   instead of being forced white on the dark panel. */
.brand-logo-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border-radius: 14px; padding: 8px 14px;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
}
.brand-logo-badge img { height: 56px; width: auto; max-width: 240px; object-fit: contain; }
/* The bundled default logo has wide empty margins above and below, so crop them to make
   the artwork readable. Uploaded logos keep the plain contain behaviour above. */
.brand-logo-badge.is-default { width: 260px; height: 76px; padding: 0; overflow: hidden; }
.brand-logo-badge.is-default img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 46%; }
.brand-mark span { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; }
.brand-copy { position: relative; z-index: 1; margin-top: 2.5rem; }
.brand-copy h1 { font-size: 1.9rem; line-height: 1.25; font-weight: 700; margin: 0 0 0.85rem 0; }
.brand-copy p { font-size: 0.92rem; color: rgba(255,255,255,0.78); line-height: 1.6; max-width: 360px; margin: 0; }
.brand-features { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 2.25rem; }
.brand-feature { display: flex; align-items: center; gap: 0.7rem; font-size: 0.85rem; color: rgba(255,255,255,0.9); }
.brand-feature .ico {
    width: 30px; height: 30px; border-radius: 8px;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-feature .ico i { font-size: 0.8rem; color: #fff; }
.brand-badge {
    display: inline-flex; align-items: center; gap: 6px;
    width: fit-content;
    background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.28);
    color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; padding: 5px 10px; border-radius: 999px;
    margin-bottom: 1rem;
}
.brand-foot { position: relative; z-index: 1; font-size: 0.75rem; color: rgba(255,255,255,0.6); }

/* Form panel */
.form-panel { padding: 3rem 2.75rem; display: flex; flex-direction: column; justify-content: center; overflow-y: auto; }
.auth-shell--narrow .form-panel { padding: 2.75rem 2.5rem; display: block; }
.form-panel-inner { width: 100%; max-width: 360px; margin: 0 auto; }
.form-head { margin-bottom: 1.85rem; }
.form-head--center { text-align: center; }
.form-head h2 { font-size: 1.4rem; font-weight: 700; color: var(--auth-ink); margin: 0 0 0.3rem 0; }
.form-head p { font-size: 0.85rem; color: var(--auth-muted); margin: 0; }
.form-head .form-logo { max-height: 64px; max-width: 100%; object-fit: contain; margin-bottom: 0.75rem; }
.form-head .icon-badge {
    width: 52px; height: 52px; border-radius: 14px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem auto;
    box-shadow: 0 10px 20px -8px rgba(15, 91, 216, 0.5);
}
.form-head .icon-badge i { color: #fff; font-size: 1.2rem; }

/* Messages */
.success-summary, .error-summary, .info-summary {
    border-radius: var(--auth-radius);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    margin-bottom: 1.35rem;
    border: 1px solid;
}
.success-summary { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.error-summary   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.info-summary    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* Fields */
.slds-form-element__label {
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.045em;
}
.slds-input {
    height: 46px;
    border-radius: var(--auth-radius);
    border: 1px solid var(--auth-line);
    background-color: var(--auth-field);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.slds-input:focus {
    border-color: var(--auth-accent);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(15, 91, 216, 0.14);
}
.slds-input-has-icon .slds-input__icon { color: #94a3b8 !important; }
/* SLDS sets both left and right on .slds-input__icon, so pin the two sides apart explicitly */
.slds-input-has-icon_left .slds-input__icon_left { left: 12px !important; right: auto !important; }
.slds-input-has-icon_right .slds-input__icon_right { left: auto !important; right: 12px !important; }

.input-otp { letter-spacing: 0.8rem; font-size: 1.5rem; font-weight: 900; text-align: center; }
.input-otp--sm { font-size: 1.3rem; font-weight: 700; }
.input-captcha { text-transform: uppercase; font-weight: 700; letter-spacing: 2px; }
.input-readonly { display: flex; align-items: center; }

/* CAPTCHA */
.captcha-row { display: flex; align-items: center; gap: 8px; margin-bottom: 0.5rem; }
.captcha-box {
    flex: 1; height: 46px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--auth-radius); background: var(--auth-field); border: 1px solid var(--auth-line);
}
.captcha-box img { height: 46px; width: 100%; object-fit: contain; cursor: pointer; }
.captcha-refresh { height: 46px; width: 46px; border-radius: var(--auth-radius); flex-shrink: 0; }
.captcha-refresh i { font-size: 1.05rem; color: var(--auth-primary); }

/* OTP box (forgot password) */
.otp-container {
    background: #f1f5fd;
    border: 1px solid #dbe5fb;
    border-radius: var(--auth-radius);
    padding: 1.1rem;
}
.otp-container label.slds-form-element__label { color: var(--auth-primary) !important; }
.otp-message { font-size: 0.8rem; display: none; }
.resend-link { color: var(--auth-accent); cursor: pointer; }
.resend-link:hover { color: var(--auth-primary); text-decoration: underline; }
.resend-message { display: none; margin-top: 4px; }

/* Buttons */
.btn-login, .btn-submit {
    height: 50px;
    border-radius: var(--auth-radius);
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    width: 100%;
    background: linear-gradient(120deg, var(--auth-primary), var(--auth-accent));
    border: none;
    box-shadow: 0 10px 22px -8px rgba(15, 91, 216, 0.55);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.btn-login:hover, .btn-submit:hover {
    background: linear-gradient(120deg, var(--auth-primary-dark), var(--auth-primary));
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -8px rgba(15, 91, 216, 0.65);
}
.btn-login:disabled, .btn-submit:disabled { opacity: 0.7; transform: none; cursor: not-allowed; }

.link-primary { color: var(--auth-accent); font-weight: 600; }
.link-primary:hover { color: var(--auth-primary); }
.back-link { text-align: center; margin-top: 1.5rem; }
.back-link a { color: var(--auth-accent); font-weight: 600; font-size: 0.85rem; }

.location-status { font-size: 0.75rem; color: #94a3b8; margin-bottom: 1rem; text-align: center; display: none; }
.footer-text { text-align: center; color: #94a3b8; font-size: 0.75rem; margin: 1.5rem 0 0 0; }
.remember-label { text-transform: none; font-size: 0.8rem; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; max-width: 460px; min-height: 0; }
    .brand-panel { display: none; }
}
