/* ============================================================
   AUTH — Login / Register / ForgotPassword / ResetPassword
   ============================================================ */

   :root {
    --auth-brand: #4361EE;
    --auth-brand-deep: #2C3FBF;
    --auth-brand-tint: rgba(67, 97, 238, 0.08);
    --auth-brand-glow: rgba(67, 97, 238, 0.18);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 900px 500px at 50% -10%, var(--auth-brand-tint), transparent 60%),
        radial-gradient(ellipse 700px 400px at 50% 110%, rgba(124, 58, 237, 0.05), transparent 60%),
        #0A0A0C;
    position: relative;
    overflow: hidden;
}

.auth-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
    pointer-events: none;
}

.auth-panel {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(180deg, #131418 0%, #0E0E10 100%);
    border: 1px solid #1F1F24;
    border-radius: 20px;
    padding: 36px;
    position: relative;
    box-shadow:
        0 20px 60px -20px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.02),
        0 0 40px -10px var(--auth-brand-glow);
    animation: authFadeUp 0.5s ease both;
    margin: 0 auto;
}

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

.auth-panel::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--auth-brand), transparent);
    opacity: 0.6;
    pointer-events: none;
}

/* Brand mark */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    color: #F4F4F5;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--auth-brand), var(--auth-brand-deep));
    display: grid;
    place-items: center;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
    position: relative;
    flex-shrink: 0;
}

.auth-brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: white;
    opacity: 0.95;
    animation: authBrandPulse 2.5s ease-in-out infinite;
}

@keyframes authBrandPulse {
    0%, 100% { opacity: 0.95; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.auth-brand span {
    display: inline-flex;
    align-items: baseline;
}

.auth-brand-accent {
    color: var(--auth-brand);
    margin-left: 1px;
}

/* Header */
.auth-header {
    margin-bottom: 28px;
    text-align: left;
}

.auth-header h1 {
    font-family: 'Inter', sans-serif;
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    color: #F4F4F5;
    line-height: 1.15;
}

.auth-header p {
    color: #9CA0AB;
    font-size: 14px;
    line-height: 1.5;
}

.auth-header p strong {
    color: #D4D4D8;
    font-weight: 500;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
}

.auth-field label {
    margin-bottom: 7px;
    color: #C9CDD5;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.auth-input {
    height: 44px;
    background: #141416;
    border: 1px solid #24252A;
    border-radius: 12px;
    padding: 0 14px;
    color: #F4F4F5;
    font-size: 14px;
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
    width: 100%;
}

.auth-input:hover {
    border-color: #2E3038;
}

.auth-input:focus {
    border-color: var(--auth-brand);
    background: #16171B;
    box-shadow: 0 0 0 3px var(--auth-brand-tint);
}

.auth-input::placeholder {
    color: #5F6270;
}

/* Row helper (email + magic link, password + forgot) */
.row.between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Checkbox */
.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #A1A5B0;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-brand);
    cursor: pointer;
}

/* Button */
.auth-button {
    height: 46px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--auth-brand) 0%, var(--auth-brand-deep) 100%);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px -4px var(--auth-brand-glow);
    margin-top: 6px;
    width: 100%;
}

.auth-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -4px rgba(67, 97, 238, 0.4);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    padding-top: 20px;
    border-top: 1px solid #1D1E22;
    font-size: 13px;
    color: #7A7E8A;
}

.auth-link {
    color: var(--auth-brand);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-link:hover {
    color: #6B85F5;
}

.auth-link-subtle {
    color: #7A7E8A;
    font-size: 12px;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-link-subtle:hover {
    color: #C9CDD5;
}

/* Errors */
.auth-error {
    margin-top: 6px;
    color: #F87171;
    font-size: 12px;
}

.auth-validation {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    display: none;
}

.auth-validation.validation-summary-errors {
    display: block;
}

.auth-validation ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-validation ul li {
    font-size: 13px;
    color: #F87171;
}

.auth-validation ul li::before {
    content: "⚠ ";
}

/* Spinner */
.auth-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}

.auth-button.loading .auth-spinner {
    display: inline-block;
}

.auth-button.loading .auth-button-label {
    opacity: 0.85;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

/* Muted helper */
.muted {
    color: #7A7E8A;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-panel {
        padding: 28px 22px;
        border-radius: 18px;
    }

    .auth-header h1 {
        font-size: 22px;
    }
}