:root {
    --auth-primary: #3b82f6;
    --auth-primary-dark: #2563eb;
    --auth-indigo: #4f46e5;
    --auth-text-light: #dbeafe;
    --auth-text-muted: rgba(191, 219, 254, 0.75);
    --auth-danger-bg: rgba(239, 68, 68, 0.2);
    --auth-danger-border: rgba(248, 113, 113, 0.35);
    --auth-danger-text: #fecaca;
    --auth-success-bg: rgba(34, 197, 94, 0.18);
    --auth-success-border: rgba(74, 222, 128, 0.35);
    --auth-success-text: #bbf7d0;
    --auth-radius: 1rem;
    --auth-radius-lg: 1.5rem;
}

* { box-sizing: border-box; }

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Instrument Sans', system-ui, sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
}

.auth-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.auth-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-bg-orb {
    position: absolute;
    width: 20rem;
    height: 20rem;
    border-radius: 50%;
    filter: blur(64px);
    opacity: 0.3;
    mix-blend-mode: multiply;
    animation: auth-blob 8s infinite ease-in-out;
}

.auth-bg-orb--blue { top: 0; left: -10rem; background: #3b82f6; }
.auth-bg-orb--purple { top: 0; right: -10rem; background: #a855f7; animation-delay: 2s; }
.auth-bg-orb--indigo { bottom: -10rem; left: 10rem; background: #6366f1; animation-delay: 4s; }

.auth-bg-grid {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

.auth-bg-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0.2;
    animation: auth-float 6s infinite ease-in-out;
}

.auth-content {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.auth-panel {
    width: 100%;
    max-width: 28rem;
    animation: auth-fade-in 0.8s ease-out both;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    margin-bottom: 1.5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-indigo) 100%);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
}

.auth-logo svg {
    width: 2.5rem;
    height: 2.5rem;
    color: #fff;
}

.auth-logo--image {
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    padding: 0.4rem;
}

.auth-logo--image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.65rem;
}

.auth-brand-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-brand-subtitle {
    margin: 0;
    font-size: 1.05rem;
    color: var(--auth-text-muted);
}

.auth-card {
    backdrop-filter: blur(24px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--auth-radius-lg);
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.35);
}

.auth-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.auth-card-desc {
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
    color: var(--auth-text-muted);
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--auth-radius);
    font-size: 0.875rem;
    line-height: 1.45;
}

.auth-alert svg {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
}

.auth-alert--error {
    background: var(--auth-danger-bg);
    border: 1px solid var(--auth-danger-border);
    color: var(--auth-danger-text);
    animation: auth-shake 0.45s ease-in-out;
}

.auth-alert--success {
    background: var(--auth-success-bg);
    border: 1px solid var(--auth-success-border);
    color: var(--auth-success-text);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text-light);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: rgba(147, 197, 253, 0.65);
    pointer-events: none;
    transition: color 0.15s ease;
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: #93c5fd;
}

.auth-input {
    width: 100%;
    height: 3rem;
    padding: 0 1rem 0 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--auth-radius);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
    color: rgba(191, 219, 254, 0.4);
}

.auth-input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.55);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-input--password {
    padding-right: 3rem;
}

.auth-input.is-invalid {
    border-color: rgba(248, 113, 113, 0.65);
}

.auth-field-error {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
    color: #fca5a5;
}

.auth-toggle-password {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: rgba(147, 197, 253, 0.65);
    cursor: pointer;
    transition: color 0.15s ease;
}

.auth-toggle-password:hover {
    color: #dbeafe;
}

.auth-toggle-password svg {
    width: 1.25rem;
    height: 1.25rem;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-turnstile {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 4.5rem;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--auth-text-muted);
    user-select: none;
}

.auth-remember input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-primary);
}

.auth-forgot {
    font-size: 0.875rem;
    color: #93c5fd;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-forgot:hover {
    color: #dbeafe;
}

.auth-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 3rem;
    margin-top: 0.25rem;
    border: 0;
    border-radius: var(--auth-radius);
    background: linear-gradient(90deg, var(--auth-primary) 0%, var(--auth-indigo) 100%);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(59, 130, 246, 0.4);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: 0.75;
    cursor: wait;
}

.auth-submit-spinner {
    width: 1.25rem;
    height: 1.25rem;
    animation: auth-spin 0.8s linear infinite;
}

.auth-footer {
    margin: 2rem 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(191, 219, 254, 0.4);
}

.auth-footer-credit {
    display: inline-block;
    margin-left: 0.35rem;
    color: rgba(191, 219, 254, 0.55);
    font-weight: 600;
}

@keyframes auth-blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(30px, 10px) scale(1.05); }
}

@keyframes auth-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

@keyframes auth-fade-in {
    from { opacity: 0; transform: translateY(1.5rem); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }

    .auth-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
