/* ============================================
   VAULTSRC - ACCOUNT PAGES
   Login, Register, Dashboard, Profile
   Dark theme matching main site
   ============================================ */

/* ===== CSS VARIABLES (same as main) ===== */
:root {
    --color-primary: #27ae60;
    --color-primary-dark: #229954;
    --color-primary-light: #2ecc71;
    --color-accent: #1abc9c;
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-error: #e74c3c;
    --color-danger: #e74c3c;
    --color-bg: #0f0f0f;
    --color-bg-elevated: #1a1a1a;
    --color-bg-card: #1e1e1e;
    --color-bg-subtle: #2a2a2a;
    --color-surface: #333;
    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-text-tertiary: #9ca3af;
    --color-text-muted: #6b7280;
    --color-border: rgba(255,255,255,0.08);
    --color-border-strong: rgba(255,255,255,0.15);
    --gradient-primary: linear-gradient(135deg, #27ae60, #2ecc71);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --transition: all 0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-primary-light); }

/* ===== AUTH PAGES (Login / Register) ===== */
.auth-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--color-bg);
    background-image:
        radial-gradient(at 20% 30%, rgba(39,174,96,0.06) 0px, transparent 50%),
        radial-gradient(at 80% 70%, rgba(26,188,156,0.05) 0px, transparent 50%);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-logo img {
    height: 48px;
    margin-bottom: 8px;
}
.auth-logo h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-logo p {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.auth-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.auth-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}
.auth-card .subtitle {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ---- OAuth buttons ---- */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-bg-subtle);
    color: var(--color-text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.oauth-btn:hover {
    background: var(--color-surface);
    border-color: var(--color-text-muted);
    color: var(--color-text-primary);
}
.oauth-btn svg { flex-shrink: 0; }
.oauth-btn.google:hover { border-color: #4285f4; }
.oauth-btn.discord:hover { border-color: #5865F2; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}
.auth-divider span {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Form elements ---- */
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: var(--transition);
    outline: none;
}
.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(39,174,96,0.15);
}
.form-input::placeholder {
    color: var(--color-text-muted);
}
.form-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
}
.form-checkbox input {
    accent-color: var(--color-primary);
    width: 16px;
    height: 16px;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39,174,96,0.3);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--color-text-muted);
}
.auth-footer a {
    font-weight: 600;
}

.auth-bottom-links {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--color-text-muted);
}
.auth-bottom-links a {
    color: var(--color-text-tertiary);
}
.auth-bottom-links a:hover {
    color: var(--color-primary);
}

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid;
}
.alert-error {
    background: rgba(231,76,60,0.1);
    border-color: rgba(231,76,60,0.3);
    color: #e74c3c;
}
.alert-success {
    background: rgba(39,174,96,0.1);
    border-color: rgba(39,174,96,0.3);
    color: #27ae60;
}
.alert-warning {
    background: rgba(243,156,18,0.1);
    border-color: rgba(243,156,18,0.3);
    color: #f39c12;
}

/* ===== ACCOUNT DASHBOARD LAYOUT ===== */
.account-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.account-sidebar {
    width: 260px;
    background: var(--color-bg-elevated);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--color-border);
}
.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.sidebar-brand img {
    height: 32px;
}
.sidebar-brand .brand-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.sidebar-user {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-user .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-bg-subtle);
    object-fit: cover;
}
.sidebar-user .user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}
.sidebar-user .user-email {
    font-size: 12px;
    color: var(--color-text-muted);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}
.nav-section {
    margin-bottom: 20px;
}
.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    padding: 0 8px;
    margin-bottom: 8px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}
.nav-link:hover {
    background: var(--color-bg-subtle);
    color: var(--color-text-primary);
}
.nav-link.active {
    background: rgba(39,174,96,0.1);
    color: var(--color-primary);
}
.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}
.nav-link .badge-count {
    margin-left: auto;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--color-border);
}
.sidebar-footer .nav-link {
    color: var(--color-text-muted);
}
.sidebar-footer .nav-link:hover {
    color: var(--color-error);
}

/* ---- Main content ---- */
.account-main {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 28px;
}
.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    font-family: var(--font-display);
}
.page-header p {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ---- Cards ---- */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-title {
    font-size: 17px;
    font-weight: 600;
}
.card-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* ---- Stats grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}
.stat-card:hover {
    border-color: var(--color-border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.stat-icon.green { background: rgba(39,174,96,0.12); color: var(--color-primary); }
.stat-icon.blue { background: rgba(52,152,219,0.12); color: #3498db; }
.stat-icon.purple { background: rgba(155,89,182,0.12); color: #9b59b6; }
.stat-icon.orange { background: rgba(243,156,18,0.12); color: #f39c12; }
.stat-value {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-display);
}
.stat-label {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ---- Tables ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
}
.data-table td {
    padding: 14px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ---- Status badges ---- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.status-badge.completed {
    background: rgba(39,174,96,0.12);
    color: #27ae60;
}
.status-badge.pending {
    background: rgba(243,156,18,0.12);
    color: #f39c12;
}
.status-badge.refunded, .status-badge.failed {
    background: rgba(231,76,60,0.12);
    color: #e74c3c;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-green { background: rgba(39,174,96,0.12); color: var(--color-primary); }
.btn-green:hover { background: rgba(39,174,96,0.2); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}
.btn-outline:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text-primary);
}

.btn-save {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.btn-save:hover { opacity: 0.9; }

/* ---- Profile form ---- */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-bg-subtle);
    object-fit: cover;
    border: 3px solid var(--color-border);
}
.profile-avatar-info h3 {
    font-size: 18px;
    font-weight: 600;
}
.profile-avatar-info p {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ---- Connected accounts ---- */
.connected-account {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}
.connected-account .provider-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.connected-account .provider-info {
    flex: 1;
}
.connected-account .provider-name {
    font-weight: 600;
    font-size: 14px;
}
.connected-account .provider-detail {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}
.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}
.empty-state h3 {
    font-size: 18px;
    margin-bottom: 6px;
    color: var(--color-text-secondary);
}
.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}
.empty-state .btn {
    display: inline-flex;
}

/* ---- Download button ---- */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(39,174,96,0.12);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}
.download-btn:hover {
    background: rgba(39,174,96,0.2);
    color: var(--color-primary-light);
}

/* ---- Mobile sidebar toggle ---- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
    z-index: 200;
    align-items: center;
    padding: 0 16px;
}
.mobile-header .menu-toggle {
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}
.mobile-header .brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    margin-left: 12px;
    color: var(--color-text-primary);
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}

@media (max-width: 768px) {
    .mobile-header { display: flex; }
    .account-sidebar {
        transform: translateX(-100%);
    }
    .account-sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open { display: block; }
    .account-main {
        margin-left: 0;
        padding: 72px 16px 32px;
    }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
