/* ═══════════════════════════════════════════════════════════════
   login.css — shared by login.php and register.php
   Depends on css/app-core.css for tokens + primitives.
   ═══════════════════════════════════════════════════════════════ */

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-shell {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: center;
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
}
.auth-brand:hover { color: var(--text); text-decoration: none; }
.auth-brand svg { color: var(--primary); width: 24px; height: 24px; }

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px;
    animation: auth-card-in 480ms var(--ease);
}
@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}
.auth-icon svg { width: 28px; height: 28px; }

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
    color: var(--text);
}
.auth-card .auth-sub {
    color: var(--muted);
    text-align: center;
    font-size: 0.94rem;
    margin: 0 0 28px;
}
.auth-card .auth-sub .role-tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 700;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.auth-field { margin-bottom: 18px; }
.auth-field label {
    display: block;
    color: var(--text-2);
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.auth-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.auth-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}
.auth-field input::placeholder { color: var(--muted-2); }

.auth-btn {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: background 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.auth-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(79, 70, 229, 0.42);
}
.auth-btn:active { transform: translateY(0); }

.auth-error,
.auth-success {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 18px;
    border: 1px solid;
    line-height: 1.5;
}
.auth-error {
    background: var(--error-light);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
}
.auth-success {
    background: var(--success-light);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.3);
}

.auth-alt {
    text-align: center;
    margin-top: 22px;
    font-size: 0.88rem;
    color: var(--muted);
}
.auth-alt a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.auth-alt a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }

/* Success / invite credential reveal */
.auth-cred-box {
    background: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 20px 0;
}
.auth-cred-box h4 {
    color: #047857;
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
}
.auth-cred-box p {
    color: var(--text-2);
    font-size: 0.86rem;
    margin: 0 0 10px;
    line-height: 1.5;
}
.auth-cred-box label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 12px;
    margin-bottom: 4px;
}
.auth-cred-box code {
    display: block;
    background: var(--surface);
    color: var(--text);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    word-break: break-all;
    cursor: pointer;
}
.auth-cred-box code:hover { background: var(--surface-2); }

/* Error / invalid-token full-page state */
.auth-state {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 48px 32px;
    text-align: center;
}
.auth-state h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--text);
    letter-spacing: -0.02em;
}
.auth-state p {
    color: var(--muted);
    font-size: 0.94rem;
    margin: 0;
    line-height: 1.55;
}
.auth-state .auth-icon { background: var(--error-light); color: var(--error); }
.auth-state.is-ok .auth-icon { background: var(--success-light); color: var(--success); }

@media (max-width: 480px) {
    .auth-card { padding: 26px 22px; border-radius: var(--radius-md); }
    body { padding: 20px 16px; }
}
