/* ===================================================
   LOGIN / REGISTER — Lightweight, Mobile-first CSS
   No external fonts · No heavy animations · Fast load
   =================================================== */

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

:root {
    --primary:    #4f46e5;
    --primary-dk: #3730a3;
    --bg:         #f0f2ff;
    --card:       #ffffff;
    --border:     #d1d5db;
    --text:       #111827;
    --muted:      #6b7280;
    --input-bg:   #f9fafb;
    --radius:     12px;
    --shadow:     0 4px 20px rgba(79,70,229,0.10);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    /* Subtle static gradient — zero performance cost */
    background-image: linear-gradient(160deg, #e0e7ff 0%, #f0f9ff 60%, #ede9fe 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
}

/* ── Layout ── */
.auth-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* ── Card ── */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e0e7ff;
    padding: 32px 28px;
}

/* ── Headings ── */
.auth-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 22px;
}

/* ── Form groups ── */
.input-group { margin-bottom: 14px; }

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    font-size: 16px; /* prevent iOS zoom */
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.14);
    background: #fff;
}

.form-control::placeholder { color: #9ca3af; }

/* ── Password toggle ── */
.password-container { position: relative; }

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--muted);
    padding: 4px;
    line-height: 1;
}

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

/* ── Form row ── */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.remember-me label {
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    margin: 0;
}

.link-muted {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.link-muted:hover { text-decoration: underline; }

/* ── Button ── */
.btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background .18s, transform .12s;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
}

.btn.primary:hover  { background: var(--primary-dk); transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }

.btn-block { width: 100%; }

/* ── OAuth divider ── */
.oauth-section { margin-top: 20px; }

.oauth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    font-size: 13px;
    color: var(--muted);
}
.oauth-divider::before,
.oauth-divider::after { content:''; flex:1; height:1px; background:var(--border); }

/* ── Google button ── */
.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s, border-color .18s;
}
.google-signin-btn:hover {
    background: #f5f5ff;
    border-color: #a5b4fc;
    color: #374151;
    text-decoration: none;
}

.google-signin-btn svg { width:20px; height:20px; flex-shrink:0; }

/* ── Signup link ── */
p.signup-text,
.signup-text {
    margin-top: 18px;
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    line-height: 1.55;
}

p.signup-text a,
.signup-text a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
p.signup-text a:hover,
.signup-text a:hover { text-decoration: underline; }

/* ── Popup ── */
.popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.popup-content {
    background: #fff;
    padding: 28px 32px;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.popup-content button {
    margin-top: 18px;
    padding: 10px 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
}
.popup-content button:hover { background: var(--primary-dk); }

/* ── Error message ── */
.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    font-size: 14px;
    text-align: center;
    margin-bottom: 14px;
}

/* ── Responsive — mobile ── */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px 18px;
        border-radius: 10px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
