/* ============================================
   NexaSuite Authentication Pages
   Shared styles for Login & Signup
   ============================================ */

/* Auth layout — split screen on desktop, stacked on mobile */
.auth-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg-body);
}

/* Left Panel — branding / illustration side */
.auth-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 48px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* Mesh gradient decor */
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(236, 72, 153, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 10%, rgba(99, 102, 241, 0.2) 0%, transparent 50%);
    animation: meshShift 15s ease-in-out infinite alternate;
    pointer-events: none;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 420px;
}

.auth-brand-content .brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

.auth-brand-content .brand-logo .logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.auth-brand-content h2 {
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.auth-brand-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 36px;
}

/* Feature list on brand panel */
.auth-features {
    text-align: left;
    width: 100%;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
}

.auth-features li .feat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Floating shapes (decorative) */
.auth-shape {
    position: absolute;
    border-radius: 16px;
    opacity: 0.1;
    z-index: 0;
}

.auth-shape-1 {
    width: 200px;
    height: 200px;
    background: #8b5cf6;
    top: 10%;
    left: -60px;
    transform: rotate(25deg);
    animation: float 8s ease-in-out infinite;
}

.auth-shape-2 {
    width: 140px;
    height: 140px;
    background: #ec4899;
    bottom: 15%;
    right: -40px;
    transform: rotate(-15deg);
    animation: float 10s ease-in-out infinite 2s;
}

.auth-shape-3 {
    width: 80px;
    height: 80px;
    background: #6366f1;
    top: 60%;
    left: 15%;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite 1s;
}

/* Right Panel — form side */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 440px;
}

/* Back to home */
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 36px;
    transition: color 0.3s, gap 0.3s;
}

.back-home:hover {
    color: var(--accent-primary);
    gap: 10px;
}

/* Form Header */
.auth-header {
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.auth-header p a {
    color: var(--accent-primary);
    font-weight: 600;
    transition: opacity 0.3s;
}

.auth-header p a:hover {
    opacity: 0.8;
}

/* OAuth Buttons */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 13px 20px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-oauth:hover {
    background: var(--glass-bg-strong);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.btn-oauth svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--divider);
}

/* Form Fields */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'Space Grotesk', sans-serif;
}

.form-input-wrapper {
    position: relative;
}

.form-input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    display: flex;
}

.form-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: var(--glass-bg);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: var(--accent-primary);
}

/* Form row (for side-by-side fields) */
.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.form-check a {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.3s;
}

.form-check a:hover {
    opacity: 0.8;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    background: var(--accent-gradient);
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.btn-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
}

.btn-submit:hover::after {
    opacity: 1;
}

.btn-submit:active {
    transform: translateY(-1px);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading spinner inside button */
.btn-submit .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

.btn-submit.loading .btn-text {
    display: none;
}

.btn-submit.loading .spinner {
    display: inline-block;
}

/* Error / Success messages */
.auth-message {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 10px;
}

.auth-message.show {
    display: flex;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
}

/* Footer link at bottom */
.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--divider);
}

.auth-footer p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Theme toggle on auth page */
.auth-theme-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
}

/* Password strength meter */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    height: 4px;
}

.password-strength .bar {
    flex: 1;
    height: 100%;
    border-radius: 2px;
    background: var(--divider);
    transition: background 0.3s;
}

.password-strength.weak .bar:nth-child(1) {
    background: #ef4444;
}

.password-strength.fair .bar:nth-child(1),
.password-strength.fair .bar:nth-child(2) {
    background: #f59e0b;
}

.password-strength.good .bar:nth-child(1),
.password-strength.good .bar:nth-child(2),
.password-strength.good .bar:nth-child(3) {
    background: #10b981;
}

.password-strength.strong .bar {
    background: #10b981;
}

.password-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Terms text */
.terms-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.terms-text a {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .auth-brand {
        padding: 48px 32px;
    }

    .auth-brand-content h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .auth-page {
        flex-direction: column;
    }

    .auth-brand {
        min-height: auto;
        padding: 48px 24px 40px;
    }

    .auth-brand-content h2 {
        font-size: 1.5rem;
    }

    .auth-brand-content p {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .auth-features {
        display: none;
        /* Hide on mobile, too much content */
    }

    .auth-form-panel {
        padding: 32px 24px;
    }

    .auth-shape {
        display: none;
    }
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .auth-header h1 {
        font-size: 1.6rem;
    }

    .auth-form-panel {
        padding: 24px 16px;
    }
}