/* ============================================================
   auth.css — Login & Signup pages
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

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

:root {
    --brand:       #4f46e5;
    --brand-dark:  #3730a3;
    --success:     #059669;
    --danger:      #dc2626;
    --gray-50:     #f8fafc;
    --gray-100:    #f1f5f9;
    --gray-200:    #e2e8f0;
    --gray-400:    #94a3b8;
    --gray-500:    #64748b;
    --gray-700:    #334155;
    --gray-900:    #0f172a;
}

html, body { height: 100%; }

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    background: var(--gray-100);
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
}

/* ── Auth Card ──────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 960px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    animation: cardIn .4s cubic-bezier(.22,.68,0,1.2);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Sidebar panel ──────────────────────────────────────────── */
.auth-panel {
    background: linear-gradient(155deg, #464647 0%, #161519 100%);
    padding: 52px 44px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-panel-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 48px;
}

.auth-panel-logo svg {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.15);
    border-radius: 10px;
    padding: 7px;
}

.auth-panel-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
}

.auth-panel-sub {
    font-size: 15px;
    opacity: .75;
    line-height: 1.65;
    margin-bottom: 40px;
}

.auth-panel-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    opacity: .9;
}

.feature-icon {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,.12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg { width: 16px; height: 16px; }

/* ── Form panel ─────────────────────────────────────────────── */
.auth-form-panel {
    padding: 52px 48px;
    overflow-y: auto;
}

.auth-form-panel h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin-bottom: 6px;
}

.auth-form-panel .sub {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 32px;
}

/* Alert */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.auth-alert svg { width: 16px; height: 16px; flex-shrink: 0; }

.auth-alert-error {
    background: #fef2f2;
    color: var(--danger);
    border-color: rgba(220,38,38,.2);
}

.auth-alert-success {
    background: #ecfdf5;
    color: var(--success);
    border-color: rgba(5,150,105,.2);
}

/* Form elements */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}

.form-control::placeholder { color: var(--gray-400); }

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

/* Role selector */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.role-option { position: relative; }

.role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.role-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}

.role-label svg { width: 16px; height: 16px; flex-shrink: 0; }

.role-option input:checked + .role-label {
    border-color: var(--brand);
    color: var(--brand);
    background: #eef2ff;
}

/* Submit button */
.btn-auth {
    width: 100%;
    padding: 12px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .1s;
    margin-top: 6px;
}

.btn-auth:hover { background: var(--brand-dark); }
.btn-auth:active { transform: scale(.99); }

/* Footer link */
.auth-footer-link {
    text-align: center;
    font-size: 13.5px;
    color: var(--gray-500);
    margin-top: 20px;
}

.auth-footer-link a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    transition: color .15s;
}

.auth-footer-link a:hover { color: var(--brand-dark); }

/* Forgot password */
.forgot-link {
    display: block;
    text-align: right;
    font-size: 12.5px;
    color: var(--gray-500);
    text-decoration: none;
    margin-top: -10px;
    margin-bottom: 18px;
    transition: color .15s;
}

.forgot-link:hover { color: var(--brand); }

/* Responsive */
@media (max-width: 700px) {
    .auth-card {
        grid-template-columns: 1fr;
        max-width: 460px;
        border-radius: 16px;
    }

    .auth-panel { display: none; }

    .auth-form-panel {
        padding: 36px 28px;
    }
}
