:root {
    /* Palette sampled from the ALLTIMES SACCO crest */
    --a-blue: #1c2fb5;
    --a-blue-dark: #121e85;
    --a-blue-deep: #0b1352;
    --a-maroon: #9c2f1f;
    --a-gold: #d4a45a;
    --a-gold-soft: #f6ead3;

    --a-bg: #f3f5fb;
    --a-surface: #ffffff;
    --a-ink: #151a3a;
    --a-muted: #5f6684;
    --a-line: #dfe3f0;
    --a-field: #ffffff;
    --a-danger: #b42318;
}

*, *::before, *::after { box-sizing: border-box; }

html, body.auth-body { min-height: 100%; margin: 0; }

body.auth-body {
    background: var(--a-bg);
    color: var(--a-ink);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) 1.1fr;
    min-height: 100vh;
}

/* Form side */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: 20px;
    background: var(--a-surface);
    border: 1px solid var(--a-line);
    border-top: 4px solid var(--a-blue);
    box-shadow: 0 1px 2px rgba(21, 26, 58, .04), 0 20px 40px -12px rgba(21, 26, 58, .14);
}

.auth-logo { display: block; width: 84px; height: 84px; margin: 0 auto 16px; object-fit: contain; }

.auth-card h2 {
    margin: 0 0 6px;
    text-align: center;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--a-ink);
}

.auth-card .auth-subtitle { margin: 0 0 28px; text-align: center; color: var(--a-muted); font-size: 14px; }

.auth-field { margin-bottom: 20px; }

.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.auth-label { margin: 0; font-size: 13px; font-weight: 600; color: var(--a-ink); }

.auth-link { font-size: 13px; font-weight: 600; color: var(--a-blue); text-decoration: none; }
.auth-link:hover, .auth-link:focus { color: var(--a-maroon); text-decoration: underline; }

.auth-input-wrap { position: relative; }

.auth-input-wrap > .fa {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 16px;
    transform: translateY(-50%);
    text-align: center;
    color: #8b93b3;
    pointer-events: none;
}

.auth-input-wrap .auth-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8b93b3;
    cursor: pointer;
}

.auth-input-wrap .auth-toggle:hover { color: var(--a-blue); background: #eef0fa; }

.auth-card .form-control,
.auth-input {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid #c9cfe3;
    border-radius: 10px;
    background: var(--a-field);
    color: var(--a-ink);
    font-size: 15px;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}

.auth-input-wrap .auth-input { padding-left: 44px; }
.auth-input-wrap.has-toggle .auth-input { padding-right: 48px; }

.auth-card .form-control::placeholder,
.auth-input::placeholder { color: #9aa1bd; opacity: 1; }

.auth-card .form-control:hover,
.auth-input:hover { border-color: #aab2d1; }

.auth-card .form-control:focus,
.auth-input:focus {
    outline: none;
    border-color: var(--a-blue);
    box-shadow: 0 0 0 4px rgba(28, 47, 181, .14);
    color: var(--a-ink);
}

/* Captcha: image and refresh grouped, code entry below */
.auth-captcha-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px 8px 8px 12px;
    border-radius: 10px;
    background: #f3f5fb;
    border: 1px solid var(--a-line);
}

.auth-captcha-box img {
    display: block;
    height: 44px;
    width: auto;
    max-width: 100%;
    border-radius: 6px;
    background: #fff;
}

.auth-refresh {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #c9cfe3;
    border-radius: 8px;
    background: #fff;
    color: var(--a-blue);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.auth-refresh:hover { background: #eef0fa; border-color: var(--a-blue); }
.auth-refresh:focus-visible { outline: 3px solid rgba(28, 47, 181, .3); outline-offset: 2px; }

.auth-card .btn,
.auth-btn {
    display: block;
    width: 100%;
    height: 50px;
    margin-top: 28px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--a-blue);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(28, 47, 181, .28);
    transition: background .15s, transform .05s;
}

.auth-card .btn:hover,
.auth-btn:hover { background: var(--a-blue-dark); color: #fff; }
.auth-card .btn:active, .auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: 3px solid rgba(28, 47, 181, .35); outline-offset: 2px; }

.auth-secure {
    margin: 20px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--a-line);
    text-align: center;
    color: var(--a-muted);
    font-size: 12px;
}

.auth-secure .fa { margin-right: 6px; color: var(--a-maroon); }

.auth-copy { color: #8b93b3; font-size: 12px; }

/* Showcase side */
.auth-showcase {
    position: relative;
    margin: 16px 16px 16px 0;
    padding: 56px;
    border-radius: 28px;
    overflow: hidden;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(460px 460px at 100% 0%, rgba(212, 164, 90, .30), transparent 65%),
        linear-gradient(150deg, var(--a-blue) 0%, var(--a-blue-deep) 100%);
}

.auth-showcase::before {
    content: "";
    position: absolute;
    right: -140px;
    bottom: -140px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 56px solid rgba(156, 47, 31, .45);
    pointer-events: none;
}

.auth-showcase > * { position: relative; z-index: 1; }

.auth-pill {
    align-self: flex-start;
    margin-bottom: 20px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(212, 164, 90, .18);
    border: 1px solid rgba(212, 164, 90, .5);
    color: var(--a-gold-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.auth-showcase h1 {
    margin: 0 0 14px;
    max-width: 480px;
    font-size: 40px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
}

.auth-showcase h1 em { font-style: normal; color: var(--a-gold); }

.auth-showcase p.lead { margin: 0 0 36px; max-width: 440px; font-size: 15px; color: rgba(255, 255, 255, .78); }

.auth-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 540px; }

.auth-tile {
    padding: 18px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
}

.auth-tile .fa {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--a-gold);
    color: var(--a-blue-deep);
    font-size: 17px;
}

.auth-tile strong { display: block; font-size: 14px; font-weight: 600; }
.auth-tile span { display: block; margin-top: 2px; font-size: 12px; color: rgba(255, 255, 255, .7); }

/* Validation and alerts */
.auth-card .text-danger,
.auth-card .field-validation-error {
    display: block;
    margin-top: 6px;
    color: var(--a-danger) !important;
    font-size: 12px;
}

.auth-card .validation-summary-errors,
.auth-card .alert-danger {
    margin-bottom: 20px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #f3c3bd;
    background: #fef3f2;
    color: var(--a-danger);
    font-size: 13px;
}

.auth-card .validation-summary-errors ul { margin: 0; padding-left: 18px; }
.auth-card .input-validation-error { border-color: var(--a-danger) !important; }

.auth-card .form-group { margin: 0 0 20px; }
.auth-card .col-md-12 { padding: 0; float: none; width: 100%; }
.auth-card a:not(.auth-link) { color: var(--a-blue); }

@media (max-width: 960px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-showcase { display: none; }
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
