/*
 * auth.css
 * Login page styles.
 *
 * Design direction: Enterprise tool, not a consumer app.
 * No gradients, no illustration. Monochrome base with a single
 * blue accent. Dense but not cramped. Feels like software.
 *
 * Palette:
 *   --bg          #F0F2F5   page background
 *   --card        #FFFFFF   card surface
 *   --border      #D1D5DB   input and divider borders
 *   --text        #111827   primary text
 *   --text-muted  #6B7280   secondary / label text
 *   --accent      #1D4ED8   primary action (blue)
 *   --accent-dark #1E40AF   hover state
 *   --error-bg    #FEF2F2   error banner background
 *   --error-text  #B91C1C   error banner text
 *   --error-border #FECACA  error banner border
 */

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

:root {
    --bg:           #F0F2F5;
    --card:         #FFFFFF;
    --border:       #D1D5DB;
    --text:         #111827;
    --text-muted:   #6B7280;
    --accent:       #1D4ED8;
    --accent-dark:  #1E40AF;
    --error-bg:     #FEF2F2;
    --error-text:   #B91C1C;
    --error-border: #FECACA;
    --radius:       6px;
    --font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                    "Helvetica Neue", Arial, sans-serif;
}

body.auth-page {
    font-family:      var(--font);
    font-size:        14px;
    line-height:      1.5;
    color:            var(--text);
    background-color: var(--bg);
    min-height:       100vh;
    display:          flex;
    align-items:      center;
    justify-content:  center;
    padding:          24px 16px;
}

/* ---- Card ------------------------------------------------- */

.auth-card {
    background:    var(--card);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       40px 36px;
    width:         100%;
    max-width:     400px;
}

/* ---- Logo ------------------------------------------------- */

.auth-logo {
    margin-bottom: 28px;
}

.auth-logo img {
    display: block;
    height:  32px;
    width:   auto;
}

/* Fallback when logo image missing: shows alt text cleanly */
.auth-logo img[alt] {
    font-size:   18px;
    font-weight: 600;
    color:       var(--text);
}

/* ---- Headings --------------------------------------------- */

.auth-heading {
    font-size:     20px;
    font-weight:   600;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.auth-sub {
    color:         var(--text-muted);
    font-size:     13px;
    margin-bottom: 24px;
}

/* ---- Error banner ----------------------------------------- */

.auth-error {
    background:    var(--error-bg);
    border:        1px solid var(--error-border);
    border-radius: var(--radius);
    color:         var(--error-text);
    font-size:     13px;
    padding:       10px 14px;
    margin-bottom: 20px;
}

/* ---- Form fields ------------------------------------------ */

.field {
    margin-bottom: 16px;
}

.field label {
    display:       block;
    font-size:     13px;
    font-weight:   500;
    color:         var(--text-muted);
    margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"] {
    display:          block;
    width:            100%;
    padding:          9px 12px;
    font-family:      var(--font);
    font-size:        14px;
    color:            var(--text);
    background:       var(--card);
    border:           1px solid var(--border);
    border-radius:    var(--radius);
    outline:          none;
    transition:       border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
    border-color: var(--accent);
    box-shadow:   0 0 0 3px rgba(29, 78, 216, 0.12);
}

.field input::placeholder {
    color: #9CA3AF;
}

/* ---- Buttons ---------------------------------------------- */

.btn-primary {
    display:          block;
    width:            100%;
    padding:          10px 16px;
    font-family:      var(--font);
    font-size:        14px;
    font-weight:      500;
    color:            #FFFFFF;
    background:       var(--accent);
    border:           none;
    border-radius:    var(--radius);
    cursor:           pointer;
    text-align:       center;
    text-decoration:  none;
    transition:       background 0.15s;
    margin-top:       8px;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--accent-dark);
    outline:    none;
}

.btn-primary:focus-visible {
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.3);
}

.btn-secondary {
    display:          block;
    width:            100%;
    padding:          10px 16px;
    font-family:      var(--font);
    font-size:        14px;
    font-weight:      500;
    color:            var(--text);
    background:       var(--card);
    border:           1px solid var(--border);
    border-radius:    var(--radius);
    cursor:           pointer;
    text-align:       center;
    text-decoration:  none;
    transition:       border-color 0.15s, background 0.15s;
}

.btn-secondary:hover,
.btn-secondary:focus {
    border-color: var(--accent);
    outline:      none;
}

/* ---- SSO button ------------------------------------------- */

.btn-sso {
    display:       flex;
    align-items:   center;
    justify-content: center;
    gap:           10px;
    width:         100%;
    padding:       10px 16px;
    font-family:   var(--font);
    font-size:     14px;
    font-weight:   500;
    color:         var(--text);
    background:    var(--card);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    cursor:        pointer;
    text-decoration: none;
    transition:    border-color 0.15s, box-shadow 0.15s;
}

.btn-sso:hover,
.btn-sso:focus {
    border-color: var(--accent);
    box-shadow:   0 0 0 3px rgba(29, 78, 216, 0.10);
    outline:      none;
}

/* Provider icon placeholders — replace src in HTML with actual SVGs */
.btn-sso__icon {
    display:          inline-block;
    width:            18px;
    height:           18px;
    background-color: var(--border);
    border-radius:    2px;
    flex-shrink:      0;
}

/* ---- Divider ---------------------------------------------- */

.auth-divider {
    display:        flex;
    align-items:    center;
    gap:            12px;
    margin:         20px 0;
    color:          var(--text-muted);
    font-size:      12px;
}

.auth-divider::before,
.auth-divider::after {
    content:    "";
    flex:       1;
    height:     1px;
    background: var(--border);
}

/* ---- Back link -------------------------------------------- */

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

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

/* ---- Responsive ------------------------------------------- */

@media (max-width: 440px) {
    .auth-card {
        padding: 28px 20px;
        border:  none;
    }
}

/* ---- Reduced motion --------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
