/* ============================================
   Synnectra — Auth Pages Styles
   Shares the same purple theme as main site
   ============================================ */

:root {
    --primary: #7C3AED;
    --primary-light: #A78BFA;
    --primary-dark: #5B21B6;
    --accent: #C084FC;
    --bg-dark: #0A0A12;
    --bg-card: #12121E;
    --bg-surface: #0F0F1A;
    --bg-input: #0D0D18;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border: rgba(148, 163, 184, 0.08);
    --border-hover: rgba(124, 58, 237, 0.3);
    --border-focus: rgba(124, 58, 237, 0.5);
    --gradient: linear-gradient(135deg, #7C3AED 0%, #A78BFA 50%, #C084FC 100%);
    --gradient-text: linear-gradient(135deg, #A78BFA, #C084FC, #E9D5FF);
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.08);
    --error-border: rgba(239, 68, 68, 0.2);
    --success: #22C55E;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ============================================
   Shared Components
   ============================================ */

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo-icon { font-size: 1.6rem; }

.logo-accent {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border: 1px solid rgba(124, 58, 237, 0.4);
}

.btn-outline:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--primary-light);
}

.btn-sm { padding: 8px 20px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ============================================
   Auth Background
   ============================================ */

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-glow {
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, rgba(124, 58, 237, 0.04) 40%, transparent 70%);
}

.auth-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 50% 50% at 50% 30%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 30%, black 20%, transparent 70%);
}

/* ============================================
   Auth Container & Card
   ============================================ */

.auth-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    animation: cardAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.auth-header .logo {
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.auth-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================
   Error Message
   ============================================ */

.auth-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--error);
    animation: shakeIn 0.4s ease;
}

@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.auth-error svg {
    flex-shrink: 0;
}

/* ============================================
   Form Styles
   ============================================ */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-label-row a {
    font-size: 0.8rem;
    color: var(--primary-light);
    transition: color var(--transition);
}

.form-label-row a:hover {
    color: var(--accent);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap svg:first-child {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition);
}

.input-wrap input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition);
}

.input-wrap input::placeholder {
    color: var(--text-muted);
}

.input-wrap input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.input-wrap input:focus ~ svg:first-child,
.input-wrap input:focus + svg {
    color: var(--primary-light);
}

.input-wrap:focus-within svg:first-child {
    color: var(--primary-light);
}

.input-wrap input.error {
    border-color: var(--error);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color var(--transition);
}

.toggle-password:hover {
    color: var(--text-secondary);
}

/* ============================================
   Password Strength
   ============================================ */

.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 3px;
    flex: 1;
    background: var(--border);
    border-radius: 2px;
    transition: background var(--transition);
}

.strength-bar.active { background: var(--error); }
.strength-bar.active.medium { background: #F59E0B; }
.strength-bar.active.strong { background: var(--success); }

.strength-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 50px;
    text-align: right;
}

/* ============================================
   Submit Button
   ============================================ */

.btn-loader svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Auth Footer
   ============================================ */

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-light);
    font-weight: 600;
    transition: color var(--transition);
}

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

/* ============================================
   Secure Badge
   ============================================ */

.auth-secure-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.auth-secure-badge svg {
    color: var(--success);
}

.remember-me-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    margin-bottom: 8px;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    padding: 6px 0;
}

.remember-me-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.custom-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    padding: 6px 0;
}

.custom-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid var(--border-hover);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.custom-checkbox svg {
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition);
    color: white;
}

.custom-checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--gradient);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.custom-checkbox-label input[type="checkbox"]:checked + .custom-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.custom-checkbox-label input[type="checkbox"]:focus-visible + .custom-checkbox {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.custom-checkbox-label a {
    color: var(--primary-light);
    text-decoration: underline;
    font-weight: 600;
    transition: color var(--transition);
}

.custom-checkbox-label a:hover {
    color: var(--accent);
}

.remember-me-label a {
    color: var(--primary-light);
    text-decoration: underline;
}

.tos-row {
    margin-top: 8px;
    margin-bottom: 8px;
}

.tos-row .custom-checkbox-label a {
    color: var(--primary-light);
    text-decoration: underline;
    font-weight: 600;
}

.twoFA-input-wrap input {
    font-family: 'Monaco', 'Consolas', monospace !important;
    letter-spacing: 0.3em;
}



/* ============================================
   Dashboard Styles
   ============================================ */

.dash-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.dash-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-nav .logo {
    font-size: 1.2rem;
}

.dash-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dash-user {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dash-main {
    padding-top: 80px;
    min-height: 100vh;
}

.dash-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px;
}

.dash-welcome {
    margin-bottom: 48px;
}

.dash-welcome h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.dash-welcome p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: all var(--transition);
    position: relative;
}

.dash-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.1);
}

.dash-card-icon {
    font-size: 1.8rem;
    margin-bottom: 14px;
}

.dash-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.dash-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.dash-badge {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-light);
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.15);
    padding: 4px 10px;
    border-radius: 100px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
    .auth-card {
        padding: 32px 24px;
    }

    .auth-header h1 {
        font-size: 1.3rem;
    }

    .dash-grid {
        grid-template-columns: 1fr;
    }

    .dash-welcome h1 {
        font-size: 1.5rem;
    }
}
