:root {
    --primary: #7000ff;
    --primary-dark: #5000b8;
    --bg-dark: #050505;
    --bg-card: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #6b7280;
    --border: rgba(112, 0, 255, 0.2);
    --v4-purple-glow: rgba(112, 0, 255, 0.4);
    --bg-deep: #020617;
    --success: #ccff00;
    --error: #ef4444;
    --link: #a78bfa;
    --link-hover: #c4b5fd;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    display: flex;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .auth-wrapper {
        grid-template-columns: 1fr 1.2fr;
    }
}

.auth-form-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: var(--bg-dark);
    position: relative;
    z-index: 10;
}

.auth-logo {
    margin-bottom: 2.5rem;
    text-align: center;
    transform: scale(0.9);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border-radius: 24px;
    padding: 2.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: authCardIn 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.auth-heading {
    margin-bottom: 2rem;
}

.auth-heading h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.auth-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.auth-alert--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.auth-alert--success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #10b981;
}

.auth-alert--info {
    background: rgba(112, 0, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-group-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.form-row-between label {
    margin-bottom: 0;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(112, 0, 255, 0.1);
}

.auth-field input.match-ok {
    border-color: rgba(16, 185, 129, 0.6);
}

.auth-field input.match-bad {
    border-color: rgba(239, 68, 68, 0.6);
}

.password-match-hint {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    min-height: 1rem;
}

.password-match-hint.ok {
    color: #10b981;
}

.password-match-hint.bad {
    color: #ef4444;
}

.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.password-strength.show {
    opacity: 1;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-bar.strength-weak {
    background: var(--error);
    width: 33%;
}

.password-strength-bar.strength-medium {
    background: #f59e0b;
    width: 66%;
}

.password-strength-bar.strength-strong {
    background: var(--success);
    width: 100%;
}

.auth-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.auth-checkbox-row input[type="checkbox"] {
    margin-top: 0.15rem;
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.auth-checkbox-row label {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    text-transform: none;
    font-weight: 400;
    letter-spacing: normal;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.auth-remember input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
}

.auth-remember label {
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 4px 15px var(--v4-purple-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--v4-purple-glow);
    filter: brightness(1.1);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: 1rem;
    text-align: center;
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.auth-divider {
    position: relative;
    margin: 2rem 0;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #374151;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #111827;
}

.auth-divider span {
    position: relative;
    background: var(--bg-card);
    padding: 0 1rem;
}

.auth-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    border: 1px solid #1f2937;
    border-radius: 12px;
    color: #d1d5db;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.auth-oauth-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.auth-oauth-btn img {
    width: 20px;
    height: 20px;
}

.auth-oauth-hint {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.auth-footer-link {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer-link a,
.auth-link {
    color: var(--link);
    font-weight: 700;
    text-decoration: none;
}

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

.auth-meta {
    margin-top: 2rem;
    font-size: 10px;
    color: #1f2937;
    font-family: ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.auth-link-sm {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--link);
    text-decoration: none;
}

.auth-link-sm:hover {
    color: var(--link-hover);
}

.auth-link-sm code {
    color: var(--link);
    font-size: inherit;
}

/* Already logged in mini-page */
.auth-standalone {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-dark);
}

.auth-standalone-card {
    max-width: 28rem;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
}

.auth-standalone-card h1 {
    font-size: 1.5rem;
    margin: 0 0 1rem;
}

.auth-standalone-card p {
    color: var(--text-muted);
    margin: 0 0 2rem;
}

.auth-standalone-card .highlight {
    color: var(--link);
    font-weight: 600;
}

.auth-standalone-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-standalone-actions .btn-dashboard {
    display: block;
    width: 100%;
    padding: 1rem;
    background: #4f46e5;
    color: white;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
}

.auth-standalone-actions .btn-dashboard:hover {
    background: #4338ca;
}

/* Desktop brand column */
.auth-brand-column {
    display: none;
    position: relative;
    background: var(--bg-deep);
    overflow: hidden;
    border-left: 1px solid var(--border);
}

@media (min-width: 1024px) {
    .auth-brand-column {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 60px;
    }

    .agent-pill {
        animation: agentSlideIn 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    }

    .agent-pill:nth-child(1) { animation-delay: 0.5s; }
    .agent-pill:nth-child(2) { animation-delay: 0.7s; }
    .agent-pill:nth-child(3) { animation-delay: 0.9s; }
}

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

#hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.6;
}

#mouse-torch {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(112, 0, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    transform: translate(-50%, -50%);
}

.brand-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    text-align: left;
}

.feature-tag {
    font-family: 'Orbitron', system-ui, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: block;
}

.brand-title {
    font-family: 'Orbitron', system-ui, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1.5rem;
    color: white;
}

.brand-title em {
    font-style: italic;
    color: #a855f7;
}

.brand-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0 0 3rem;
}

.agent-pill {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: border-color 0.3s ease, background 0.3s ease;
    opacity: 0;
    transform: translateX(30px);
}

.agent-pill:hover {
    border-color: var(--primary);
    background: rgba(112, 0, 255, 0.05);
}

.agent-icon {
    width: 50px;
    height: 50px;
    background: rgba(112, 0, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.agent-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.agent-info h4 {
    font-weight: 700;
    color: white;
    margin: 0 0 0.25rem;
}

.agent-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}
