/* ═══════════════════════════════════════════════════════════════════════════
   auth.css – AI Coaching Platform
   Shared Styles für alle Auth-Screens (Login, Reset, Magic Link)
   Mobile-first · Apple-ähnliches Design
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── RESET & TOKENS ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #f5f5f7;
    --card:        #ffffff;
    --text:        #1d1d1f;
    --text2:       #6e6e73;
    --border:      #d2d2d7;
    --border-focus:#0071e3;
    --primary:     #0071e3;
    --primary-h:   #0077ed;
    --success:     #34c759;
    --error:       #ff3b30;
    --warn:        #ff9500;
    --info:        #0071e3;
    --radius:      14px;
    --radius-sm:   10px;
    --shadow:      0 2px 24px rgba(0,0,0,.08);
    --font:        -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                   'Helvetica Neue', Arial, sans-serif;
    --mono:        ui-monospace, 'SF Mono', 'Cascadia Mono', monospace;
}

/* ── BASE ────────────────────────────────────────────────────────────────── */
html { font-size: 16px; }

body {
    font-family:        var(--font);
    background:         var(--bg);
    color:              var(--text);
    min-height:         100vh;
    display:            flex;
    align-items:        center;
    justify-content:    center;
    padding:            24px 16px 48px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── WRAPPER & CARD ──────────────────────────────────────────────────────── */
.auth-wrap {
    width:     100%;
    max-width: 420px;
}

.auth-card {
    background:    var(--card);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    padding:       40px 32px;
    width:         100%;
}

/* ── HEADER ──────────────────────────────────────────────────────────────── */
.auth-icon {
    font-size:     3rem;
    text-align:    center;
    margin-bottom: 14px;
    line-height:   1;
}

.auth-title {
    font-size:      1.5rem;
    font-weight:    700;
    letter-spacing: -.035em;
    color:          var(--text);
    text-align:     center;
    margin-bottom:  6px;
}

.auth-sub {
    font-size:     .875rem;
    color:         var(--text2);
    text-align:    center;
    line-height:   1.55;
    margin-bottom: 24px;
}

/* ── TABS (Passwort / Magic Link) ────────────────────────────────────────── */
.auth-tabs {
    display:          flex;
    border-radius:    var(--radius-sm);
    background:       var(--bg);
    padding:          4px;
    margin-bottom:    22px;
    gap:              4px;
}

.auth-tab {
    flex:              1;
    text-align:        center;
    padding:           9px 12px;
    border-radius:     8px;
    font-size:         .875rem;
    font-weight:       500;
    color:             var(--text2);
    text-decoration:   none;
    transition:        background .2s, color .2s, box-shadow .2s;
}

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

.auth-tab.active {
    background:  var(--card);
    color:       var(--primary);
    font-weight: 600;
    box-shadow:  0 1px 6px rgba(0,0,0,.1);
}

/* ── ALERTS ──────────────────────────────────────────────────────────────── */
.alert {
    padding:       12px 15px;
    border-radius: var(--radius-sm);
    font-size:     .875rem;
    line-height:   1.5;
    margin-bottom: 18px;
}

.alert-error {
    background: #fff0ee;
    color:      #c0392b;
    border:     1px solid #ffc9c3;
}

.alert-success {
    background: #f0fdf4;
    color:      #1a7a35;
    border:     1px solid #b7f0c9;
}

.alert-warn {
    background: #fffbf0;
    color:      #995500;
    border:     1px solid #fde8b2;
}

.alert-info {
    background: #f0f4ff;
    color:      #1a3a8c;
    border:     1px solid #c2d1ff;
}

/* ── FORM FIELDS ─────────────────────────────────────────────────────────── */
.field {
    margin-bottom: 16px;
}

.field label {
    display:        block;
    font-size:      .75rem;
    font-weight:    700;
    color:          var(--text2);
    margin-bottom:  6px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
    width:           100%;
    padding:         11px 14px;
    border:          1.5px solid var(--border);
    border-radius:   var(--radius-sm);
    font-size:       .95rem;
    color:           var(--text);
    background:      #fff;
    outline:         none;
    font-family:     var(--font);
    transition:      border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance:      none;
}

.field input:focus {
    border-color: var(--border-focus);
    box-shadow:   0 0 0 3px rgba(0,113,227,.15);
}

.field input::placeholder {
    color: #b0b0b8;
}

/* Autofill-Styling (Webkit) */
.field input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #fff inset;
    -webkit-text-fill-color: var(--text);
}

.field-hint {
    font-size:   .78rem;
    color:       var(--text2);
    margin-top:  5px;
    line-height: 1.45;
}

/* ── PASSWORD STRENGTH METER ─────────────────────────────────────────────── */
.pw-bar {
    height:        4px;
    border-radius: 2px;
    background:    var(--border);
    margin-top:    7px;
    overflow:      hidden;
}

.pw-fill {
    height:     100%;
    border-radius: 2px;
    width:      0;
    transition: width .3s ease, background .3s ease;
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    gap:             7px;
    padding:         13px 22px;
    border-radius:   var(--radius-sm);
    font-size:       .95rem;
    font-weight:     600;
    cursor:          pointer;
    border:          none;
    font-family:     var(--font);
    text-decoration: none;
    transition:      background .2s, transform .15s, box-shadow .2s;
    -webkit-appearance: none;
    appearance:      none;
}

.btn-primary {
    background: var(--primary);
    color:      #fff;
    width:      100%;
    margin-top: 8px;
}

.btn-primary:hover:not(:disabled) {
    background:  var(--primary-h);
    transform:   translateY(-1px);
    box-shadow:  0 6px 18px rgba(0,113,227,.28);
}

.btn-primary:active {
    transform:  translateY(0);
    box-shadow: none;
}

.btn-primary:disabled {
    background: #a8caee;
    cursor:     not-allowed;
}

/* ── AUTH FOOTER (Links) ─────────────────────────────────────────────────── */
.auth-footer {
    text-align:  center;
    margin-top:  20px;
    font-size:   .875rem;
}

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

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

/* ── DIVIDER ─────────────────────────────────────────────────────────────── */
.auth-divider {
    display:         flex;
    align-items:     center;
    gap:             12px;
    margin:          20px 0;
    font-size:       .78rem;
    color:           var(--text2);
}

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

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    body { padding: 16px 12px 40px; align-items: flex-start; }

    .auth-wrap { max-width: 100%; }

    .auth-card { padding: 28px 20px; }

    .auth-title { font-size: 1.3rem; }

    .auth-tab { font-size: .8rem; padding: 8px 8px; }
}

/* ── REDUCED MOTION ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* ── DARK MODE (optional, falls Browser-Präferenz) ───────────────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        --bg:     #1c1c1e;
        --card:   #2c2c2e;
        --text:   #f5f5f7;
        --text2:  #8e8e93;
        --border: #3a3a3c;
    }
    .field input[type="email"],
    .field input[type="password"],
    .field input[type="text"] {
        background:   #1c1c1e;
        color:        #f5f5f7;
        border-color: #3a3a3c;
    }
    .field input:-webkit-autofill {
        -webkit-box-shadow: 0 0 0 30px #1c1c1e inset;
        -webkit-text-fill-color: #f5f5f7;
    }
    .auth-tabs { background: #1c1c1e; }
    .auth-tab.active { background: #2c2c2e; }
    .alert-error   { background: #3a1a18; border-color: #7a2a28; }
    .alert-success { background: #1a3a22; border-color: #2a6a42; }
    .alert-info    { background: #1a2a4a; border-color: #2a4a8a; }
}
