/* auth.css — shared styles for the login and register pages.
   Replaces the duplicated login.css / register.css with one polished design:
   icon-inset inputs, inline alert banners, and password show/hide toggles. */

:root {
    --primary: #0984e3;
    --primary-dark: #0770c4;
    --secondary: #0a4d7a;
    --primary-tint: #e7f2fc;
    --dark: #2d3436;
    --success: #00b894;
    --warning: #b8860b;
    --danger: #d63031;
    --gray: #636e72;
    --border: #e0e6ed;
    --border-radius: 12px;
    --shadow: 0 10px 30px rgba(15, 47, 79, 0.12);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: #f5f6f8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 2.25rem 2rem;
    margin-bottom: 1rem;
}

/* ---- sign-in tabs (segmented control: operator | admin) ---- */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 1.6rem;
    background: #eef1f6;
    border: 1px solid var(--border);
    border-radius: 11px;
}

.auth-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
}

.auth-tab i { font-size: 0.95rem; }

.auth-tab:hover { color: var(--secondary); }

.auth-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.25);
}

.auth-tab.is-active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(15, 47, 79, 0.12);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo-badge {
    width: 58px;
    height: 58px;
    margin: 0 auto 0.9rem;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.auth-logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: 0.2px;
}

.auth-header h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.15rem;
    color: var(--dark);
    margin-top: 0.35rem;
}

.auth-sub {
    color: var(--gray);
    font-size: 0.88rem;
    margin-top: 0.2rem;
}

/* ---- inline alert banners (Django messages) ---- */
.alert {
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 1.1rem;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    gap: 9px;
    align-items: flex-start;
    border: 1px solid transparent;
}

.alert i { margin-top: 2px; }

.alert-success {
    background: #e9f9f3;
    border-color: #bfe9da;
    color: #0b6e4f;
}

.alert-error {
    background: #fdf0f0;
    border-color: #f2cfcf;
    color: #a33033;
}

.alert-warning {
    background: #fdf8ec;
    border-color: #ecdcae;
    color: #8a6508;
}

.alert-info {
    background: #eef5fd;
    border-color: #cfe3f7;
    color: #1d5d90;
}

/* ---- form fields ---- */
.form-group {
    margin-bottom: 1.15rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--dark);
}

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

.input-icon {
    position: absolute;
    left: 13px;
    color: #9aa7b4;
    font-size: 0.95rem;
    pointer-events: none;
}

input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--dark);
    background: #fbfcfe;
    transition: var(--transition);
}

.input-wrap input { padding-left: 38px; }
.input-wrap.has-toggle input { padding-right: 42px; }

input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.15);
}

/* eye show/hide button */
.password-toggle {
    position: absolute;
    right: 6px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #9aa7b4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--primary-tint);
}

.hint {
    font-size: 0.78rem;
    color: var(--gray);
    margin-top: 0.35rem;
}

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.98rem;
    letter-spacing: 0.2px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
}

.btn:hover,
.btn:focus-visible {
    background: var(--primary-dark);
    color: #fff;
}

.auth-switch {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray);
}

.auth-switch a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

.auth-footer {
    text-align: center;
    color: var(--gray);
    font-size: 0.82rem;
}

.pending-note {
    margin-top: 0.9rem;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fdf8ec;
    border: 1px dashed #ecdcae;
    color: #8a6508;
    font-size: 0.82rem;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}


/* ---------------- LANDING PAGE (role chooser) ---------------- */
.landing-card { text-align: center; }

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-top: 1.75rem;
}

.landing-option {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
}

.landing-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px 16px;
    /* Same 2px frame on both options, so the filled and outlined buttons are
       exactly the same height. */
    border: 2px solid transparent;
    text-decoration: none;
}

.landing-actions .btn i {
    font-size: 1.05rem;
    line-height: 1;
}

.landing-actions .btn.btn-outline {
    background: #ffffff;
    border-color: var(--primary);
    color: var(--primary);
}

.landing-actions .btn.btn-outline:hover,
.landing-actions .btn.btn-outline:focus-visible {
    background: var(--primary-tint);
    border-color: var(--secondary);
    color: var(--secondary);
}

.landing-caption {
    font-size: 0.8rem;
    color: var(--gray);
}

/* ---------------- FOOTER CREDIT (login / register) ---------------- */
.auth-credit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--gray);
}

.auth-credit a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.auth-credit a:hover,
.auth-credit a:focus-visible { border-bottom-color: currentColor; }

.auth-credit .footer-version {
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.auth-credit .footer-version:hover { border-color: var(--primary); }

.auth-credit .footer-dot { opacity: 0.45; }
