/* Shared design for login / forgot-password / reset-password pages */

:root {
    --auth-primary: #2c5cf6;
    --auth-primary-dark: #1e42c4;
    --auth-ink: #1b2233;
    --auth-muted: #6b7280;
    --auth-border: #e2e5ec;
    --auth-bg-1: #101c3d;
    --auth-bg-2: #1c3f8f;
    --auth-bg-3: #2c5cf6;
}

* {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    font-family: 'Roboto Condensed', Arial, Helvetica, sans-serif;
    color: var(--auth-ink);
    background: linear-gradient(135deg, var(--auth-bg-1) 0%, var(--auth-bg-2) 55%, var(--auth-bg-3) 100%);
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(9, 15, 35, 0.35);
    padding: 36px 32px 32px;
    animation: auth-rise 0.35s ease-out;
}

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

.auth-logo {
    display: block;
    max-height: 52px;
    margin: 0 auto 20px;
}

.auth-logo-mark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-primary);
    color: #fff;
    font-size: 26px;
}

.auth-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--auth-ink);
}

.auth-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--auth-muted);
    margin: 0 0 24px;
    line-height: 1.5;
}

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

.auth-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--auth-muted);
    margin-bottom: 6px;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: #f8f9fc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input-wrap:focus-within {
    border-color: var(--auth-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(44, 92, 246, 0.12);
}

.auth-input-wrap .auth-icon {
    width: 42px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 15px;
    flex-shrink: 0;
}

.auth-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    padding: 12px 12px 12px 0;
    font-size: 15px;
    color: var(--auth-ink);
    min-width: 0;
}

.auth-input-wrap .auth-toggle {
    width: 42px;
    flex-shrink: 0;
    text-align: center;
    color: var(--auth-muted);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 15px;
    padding: 0;
}

.auth-input-wrap .auth-toggle:hover {
    color: var(--auth-ink);
}

.auth-row-between {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: -6px 0 18px;
}

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

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

.auth-submit {
    width: 100%;
    border: none;
    border-radius: 10px;
    background: var(--auth-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 13px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, transform 0.05s ease;
}

.auth-submit:hover {
    background: var(--auth-primary-dark);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit:disabled {
    opacity: 0.7;
    cursor: default;
}

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

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

.auth-submit.is-loading .auth-submit-label {
    opacity: 0.85;
}

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

.auth-back {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--auth-muted);
    text-decoration: none;
}

.auth-back:hover {
    color: var(--auth-ink);
    text-decoration: underline;
}

/* Matches the markup MY_Controller::setMessage() renders into flashdata -
   `.alert.alert-{success,danger,warning,info}.alert-dismissable` - rather
   than a separate invented class, so the PHP-generated flash message picks
   this styling up automatically wherever it's echoed on an auth page. */
.auth-card .alert {
    border-radius: 10px;
    padding: 11px 40px 11px 14px;
    font-size: 13px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    position: relative;
}

.auth-card .alert .icon {
    margin-right: 6px;
}

.auth-card .alert-success {
    background: #e9f9ee;
    border-color: #b7ecc6;
    color: #187a3f;
}

.auth-card .alert-danger {
    background: #fdecec;
    border-color: #f6c6c6;
    color: #b3261e;
}

.auth-card .alert-warning {
    background: #fff6e5;
    border-color: #f5deab;
    color: #8a5a00;
}

.auth-card .alert-info {
    background: #eaf1ff;
    border-color: #c3d6ff;
    color: #2445a8;
}

.auth-card .alert button.close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 16px;
    line-height: 1;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
}

.auth-card .alert button.close:hover {
    opacity: 1;
}

.auth-hint {
    font-size: 12px;
    color: var(--auth-muted);
    margin-top: -12px;
    margin-bottom: 18px;
    line-height: 1.5;
}

@media (max-width: 420px) {
    .auth-card {
        padding: 28px 22px 26px;
        border-radius: 12px;
    }
}
