/* Agent auth pages (Partner Login, Reset Credentials): 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-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;
    color: var(--auth-ink);
    background:
        radial-gradient(900px 500px at 10% 0%, rgba(15, 91, 216, 0.12), transparent 60%),
        radial-gradient(800px 500px at 100% 100%, rgba(27, 58, 138, 0.14), transparent 60%),
        #eef2f9;
}

/* Split shell (login) */
.auth-shell {
    width: 100%;
    max-width: 980px;
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    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);
}

/* Single card (reset credentials) */
.login-card {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem 2rem;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.brand-logo { max-height: 50px; margin: 0 auto 1.5rem auto; display: block; object-fit: contain; }
.card-title { color: var(--auth-primary); font-size: 1.4rem; }

/* 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; }
/* 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-copy { position: relative; z-index: 1; margin-top: 2.5rem; }
.brand-copy h1 { font-size: 2rem; 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-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; }
.form-panel-inner { width: 100%; max-width: 360px; margin: 0 auto; }
.form-head { margin-bottom: 2rem; }
.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; }

/* Fields */
.slds-input {
    height: 46px !important;
    border-radius: var(--auth-radius) !important;
    padding-left: 2.85rem !important;
    font-size: 0.92rem !important;
    border: 1px solid var(--auth-line) !important;
    color: #1e293b !important;
    background-color: var(--auth-field) !important;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s !important;
}
.slds-input:focus {
    border-color: var(--auth-accent) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(15, 91, 216, 0.14) !important;
    outline: 0 !important;
}
div.slds-input.slds-theme_shade {
    background-color: #eef2f7 !important;
    border-color: var(--auth-line) !important;
    color: #475569 !important;
    display: flex;
    align-items: center;
}
.slds-input-has-icon .slds-input__icon {
    left: 0.95rem !important;
    width: 1.1rem !important;
    height: 1.1rem !important;
    color: #94a3b8 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !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-with-toggle { padding-right: 3rem !important; }
.password-toggle-icon { cursor: pointer; pointer-events: auto !important; }

label.slds-form-element__label,
.slds-form-element__label {
    display: inline-block;
    font-weight: 600 !important;
    color: #334155 !important;
    font-size: 0.72rem !important;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    margin-bottom: 0.4rem !important;
}
.slds-checkbox__label { display: inline-flex !important; align-items: center !important; cursor: pointer; }
.slds-checkbox__label .slds-checkbox_faux {
    margin-right: 0.5rem !important; margin-top: 0 !important; flex-shrink: 0;
    border: 1px solid #cbd5e1 !important; border-radius: 4px !important;
}
.slds-checkbox .slds-form-element__label {
    font-size: 0.85rem !important; color: #334155 !important; text-transform: none !important;
    letter-spacing: normal !important; margin-bottom: 0 !important; font-weight: 500 !important;
    display: inline-block !important; vertical-align: middle !important;
}

/* OTP input and box */
.input-otp { text-align: center; font-weight: 700; letter-spacing: 0.8rem; padding-left: 0 !important; }
.input-otp--lg { font-size: 1.25rem !important; letter-spacing: 0.6rem; background: #fff !important; }
.input-pin { letter-spacing: 0.3rem; }
.input-captcha { text-transform: uppercase; font-weight: 700; letter-spacing: 2px; }
.otp-container {
    background: #f1f5fd !important;
    border: 1px solid #dbe5fb !important;
    border-radius: var(--auth-radius) !important;
    padding: 1.1rem !important;
}
.otp-container label.slds-form-element__label { color: var(--auth-primary) !important; }
.otp-message { font-size: 0.8rem; display: none; color: var(--auth-accent); }
.resend-link { color: var(--auth-accent) !important; transition: color 0.2s; }
.resend-link:hover { color: var(--auth-primary) !important; text-decoration: underline !important; }

/* 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); }

/* Buttons */
.slds-button_brand {
    height: 48px !important;
    width: 100% !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    border-radius: var(--auth-radius) !important;
    background: linear-gradient(120deg, var(--auth-primary), var(--auth-accent)) !important;
    border: none !important;
    color: #fff !important;
    letter-spacing: 0.3px;
    box-shadow: 0 10px 22px -8px rgba(15, 91, 216, 0.55);
    transition: transform 0.15s, box-shadow 0.2s !important;
}
.slds-button_brand:hover {
    background: linear-gradient(120deg, var(--auth-primary-dark), var(--auth-primary)) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 12px 26px -8px rgba(15, 91, 216, 0.65) !important;
}
.slds-button_brand:disabled { opacity: 0.75 !important; transform: none !important; }

.tab-btn {
    flex: 1; width: 100%;
    padding: 0.6rem 0.5rem;
    border-radius: var(--auth-radius);
    border: 1px solid var(--auth-line);
    background: var(--auth-field);
    color: var(--auth-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.tab-btn.active {
    background: var(--auth-primary);
    color: #fff;
    border-color: var(--auth-primary);
    box-shadow: 0 6px 14px -6px rgba(27, 58, 138, 0.5);
}

/* Messages */
.error-summary, .error-alert, .info-container {
    padding: 0.85rem 1rem;
    border-radius: var(--auth-radius);
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid;
}
.error-summary { color: #b91c1c; background: #fef2f2; border-color: #fecaca; font-weight: 600; }
.error-alert   { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.info-container { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.error-alert ul, .error-alert .validation-summary-errors ul { list-style-type: none; margin: 0; padding: 0; }

/* Links */
.forgot-link, .link-primary { color: var(--auth-accent); font-weight: 600; }
.forgot-link:hover, .link-primary:hover { color: var(--auth-primary); }
.footer-links i { font-size: 1.05rem; color: #94a3b8; transition: color 0.2s; }
.footer-links i:hover { color: var(--auth-accent); }

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