/* =============================================
   auth.css — Shared styles for Login & Register
   ============================================= */

/* ---------- CSS Variables ---------- */
:root[data-theme="dark"] {
    --bg: #0f1117;
    --card: #1a1d2e;
    --border: #2d3250;
    --text: #e2e8f0;
    --muted: #8892a4;
    --accent: #6c63ff;
    --input-bg: #0f1117;
}
:root[data-theme="light"] {
    --bg: #f0f2f8;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --accent: #6c63ff;
    --input-bg: #f8fafc;
}

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

/* ---------- Body ---------- */
body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ---------- Animated Background ---------- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(108,99,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* ---------- Theme Toggle Button ---------- */
.theme-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    z-index: 10;
    transition: all 0.2s;
}
.theme-btn:hover { background: var(--accent); color: #fff; }

/* ---------- Auth Container ---------- */
.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 1;
}

/* Register page has slightly wider container */
.auth-container.wide { max-width: 440px; }

/* ---------- Logo / Header ---------- */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.logo-circle {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #6c63ff, #9c55ff);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    margin-bottom: 14px;
    box-shadow: 0 8px 32px rgba(108,99,255,0.4);
}
.auth-title { font-size: 26px; font-weight: 800; }
.auth-sub   { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ---------- Card ---------- */
.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ---------- Form ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
    display: block;
}
.input-wrap { position: relative; }
.input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 13px 14px 13px 40px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
select.form-control { padding-left: 40px; appearance: none; }

.error-text { font-size: 12px; color: #ef4444; margin-top: 5px; }

/* ---------- Role Grid (Register) ---------- */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-option input { display: none; }
.role-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--input-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.role-label i { font-size: 22px; }
.role-option input:checked + .role-label {
    border-color: var(--accent);
    background: rgba(108,99,255,0.1);
    color: var(--accent);
}

/* ---------- Submit Button ---------- */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6c63ff, #9c55ff);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}
.btn-submit:hover  { opacity: 0.9; transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }

/* ---------- Footer Link ---------- */
.auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--muted);
}
.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }

/* ---------- Alert ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 13px;
    background: rgba(239,68,68,0.12);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.25);
}
.error-list { margin: 0; padding-left: 18px; }
