/* ============================================================
   AUTH PAGES (login / register) — light theme, matching the
   homepage: white card on a soft light backdrop with the same
   faint grid + gentle brand-colour glows.
   ============================================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px 60px;
    background: linear-gradient(45deg, var(--light), var(--light-secondary));
    position: relative;
    overflow: hidden;
}

/* Faint blueprint grid, like the hero pages */
.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--hairline) 1px, transparent 1px),
        linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 42%, #000 0%, rgba(0,0,0,0.3) 60%, transparent 85%);
            mask-image: radial-gradient(ellipse 70% 70% at 50% 42%, #000 0%, rgba(0,0,0,0.3) 60%, transparent 85%);
}

.auth-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 80% at 10% 20%, rgba(37, 99, 235, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 60% 60% at 85% 75%, rgba(6, 182, 212, 0.07) 0%, transparent 60%);
    pointer-events: none;
}

.auth-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.1;
    animation: floatOrb 8s ease-in-out infinite;
}

.auth-orb:nth-child(1) {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -80px;
    left: -80px;
    animation-delay: 0s;
}

.auth-orb:nth-child(2) {
    width: 200px;
    height: 200px;
    background: var(--accent-cyan);
    bottom: -50px;
    right: -50px;
    animation-delay: 3s;
}

.auth-orb:nth-child(3) {
    width: 150px;
    height: 150px;
    background: var(--accent-pink);
    top: 50%;
    left: 60%;
    animation-delay: 5s;
}

@keyframes floatOrb {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    background: var(--light);
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    padding: 48px 44px;
    box-shadow: var(--shadow-xl), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-mark {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
}

.auth-logo-mark span {
    display: block;
    border-radius: 4px;
    background: var(--primary);
    animation: cubePop 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.auth-logo-mark span:nth-child(1) { animation-delay: 0.1s; background: var(--primary); }
.auth-logo-mark span:nth-child(2) { animation-delay: 0.2s; background: var(--primary-light); }
.auth-logo-mark span:nth-child(3) { animation-delay: 0.3s; background: var(--accent-cyan); }
.auth-logo-mark span:nth-child(4) { animation-delay: 0.4s; background: var(--accent); }

@keyframes cubePop {
    from { opacity: 0; transform: scale(0); }
    to   { opacity: 1; transform: scale(1); }
}

.auth-logo-name {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.05em;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--muted);
    text-align: center;
    margin-bottom: 36px;
}

.auth-messages {
    margin-bottom: 20px;
}

.auth-message {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #b91c1c;
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #047857;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-form .input-wrap {
    position: relative;
}

.auth-form .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-light);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--light-secondary);
    border: 1px solid var(--hairline-strong);
    border-radius: 14px;
    color: var(--ink);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.auth-form input::placeholder {
    color: var(--gray-light);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-form input:focus + .input-icon,
.auth-form .input-wrap:focus-within .input-icon {
    color: var(--primary);
}

.auth-form .field-errors {
    margin-top: 6px;
    list-style: none;
    padding: 0;
}

.auth-form .field-errors li {
    font-size: 0.82rem;
    color: #dc2626;
    padding: 2px 0;
}

.auth-form .form-help {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--gray-light);
    list-style: none;
    padding: 0;
}

.auth-form .form-help li {
    padding: 1px 0;
}

.auth-submit {
    width: 100%;
    padding: 15px;
    margin-top: 8px;
    background: var(--grad-brand);
    border: none;
    border-radius: var(--r-pill);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-brand);
}

.auth-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.14), transparent);
    transition: left 0.4s ease;
}

.auth-submit:hover::before { left: 100%; }

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.36);
}

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

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0;
}

.auth-divider span {
    font-size: 0.85rem;
    color: var(--gray-light);
    white-space: nowrap;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--hairline-strong);
}

.auth-alt-link {
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
}

.auth-alt-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-alt-link a:hover {
    color: var(--primary-dark);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

.auth-back:hover {
    color: var(--ink);
}

@media (max-width: 520px) {
    .auth-card {
        padding: 36px 24px;
        border-radius: 20px;
    }
}
