/* ============================================
   PSYCHE AI Tracker — Auth Pages Styles
   ============================================ */

/* === Auth Background === */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-primary);
}

.auth-mesh {
    position: absolute;
    inset: 0;
    background: var(--gradient-mesh);
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.auth-orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(6, 182, 212, 0.12);
    top: -10%;
    left: -5%;
    animation: orbDrift 12s ease-in-out infinite;
}

.auth-orb-2 {
    width: 350px;
    height: 350px;
    background: rgba(168, 85, 247, 0.12);
    bottom: -10%;
    right: -5%;
    animation: orbDrift 12s ease-in-out infinite 4s;
}

.auth-orb-3 {
    width: 200px;
    height: 200px;
    background: rgba(236, 72, 153, 0.08);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbDrift 12s ease-in-out infinite 8s;
}

@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.1); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* === Auth Page Layout === */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + var(--space-8)) var(--space-6) var(--space-8);
}

/* === Auth Card === */
.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-glass);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-3xl);
    padding: var(--space-10);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: cardAppear 0.4s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

[data-theme="light"] .auth-card {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

/* Shake animation for errors */
.auth-card.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-6px); }
    30%, 70% { transform: translateX(6px); }
}

/* === Auth Header === */
.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    object-fit: contain;
}

.auth-header h1 {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    font-weight: 800;
    margin-bottom: var(--space-2);
}

.auth-header p {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* === Form Styles === */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-link {
    font-size: var(--text-xs);
    color: var(--cyan-400);
    font-weight: 500;
    transition: color var(--transition-base);
}
.form-link:hover {
    color: var(--cyan-300);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-4);
    color: var(--text-tertiary);
    pointer-events: none;
    width: 18px;
    height: 18px;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-4) + 26px);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--text-sm);
    transition: all var(--transition-base);
}

.input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.input-wrapper input:focus {
    border-color: var(--cyan-500);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15), 0 0 20px rgba(6, 182, 212, 0.1);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
    color: var(--cyan-400);
}

.password-toggle {
    position: absolute;
    right: var(--space-3);
    color: var(--text-tertiary);
    padding: var(--space-1);
    transition: color var(--transition-base);
}
.password-toggle:hover {
    color: var(--text-primary);
}
.password-toggle svg {
    width: 18px;
    height: 18px;
}

/* === Password Strength === */
.password-strength {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-1);
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--surface-3);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

.strength-text {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
    font-weight: 500;
}

/* === Checkbox === */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.form-check input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
    margin-top: 1px;
    padding: 0;
}

.form-check input[type="checkbox"]:checked {
    background: var(--gradient-primary);
    border-color: var(--cyan-500);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.form-check label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.4;
}

/* === Divider === */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-6) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* === Social Login === */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.social-btn:hover {
    background: var(--surface-3);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

/* === Footer Text === */
.auth-footer-text {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-top: var(--space-6);
}

.gradient-text-link {
    color: var(--cyan-400);
    font-weight: 600;
    transition: color var(--transition-base);
}

.gradient-text-link:hover {
    color: var(--cyan-300);
}

/* === Spinner === */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Responsive === */
@media (max-width: 520px) {
    .auth-card {
        padding: var(--space-6);
        border-radius: var(--radius-2xl);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .social-login {
        grid-template-columns: 1fr;
    }
}
