/* goauth.me - Modern Design System */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
    /* Colors */
    --primary: #4F46E5;
    --primary-hover: #4338ca;
    --primary-light: #EEF2FF;
    --secondary: #64748B;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    
    /* Backgrounds */
    --bg-body: #F3F4F6;
    --bg-card: #FFFFFF;
    --bg-subtle: #F9FAFB;
    --bg-sidebar: #FFFFFF;
    
    /* Text */
    --text-main: #111827;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    
    /* Borders */
    --border-color: #E5E7EB;
    
    /* Spacing & Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
a.link { color: var(--primary); font-weight: 500; }
a.link:hover { text-decoration: underline; }

/* --- Layout Containers --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container-narrow {
    max-width: 480px;
}

/* --- Auth Layout (New) --- */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    padding: 1rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    overflow: hidden; /* prevent body scroll on auth screens */
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid white;
    max-height: calc(100dvh - 2rem);
    overflow: auto; /* allow card to scroll if content exceeds viewport */
}

.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-logo { display: inline-flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; color: var(--text-main); font-weight: 700; font-size: 1.5rem; }
.auth-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.5rem 0; }
.auth-subtitle { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.auth-footer { text-align: center; margin-top: 2rem; font-size: 0.9rem; color: var(--text-muted); }

/* --- Branding (Old/Shared) --- */
.brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.brand-logo img {
    width: 48px; height: 48px;
    border-radius: 12px;
}
.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* --- Dashboard Layout --- */
.dashboard-body { min-height: 100vh; }
.dashboard-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header { height: 70px; display: flex; align-items: center; padding: 0 1.5rem; border-bottom: 1px solid var(--border-color); }
.sidebar-header .logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.25rem; }

.sidebar-nav { padding: 1.5rem 1rem; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
}
.nav-item:hover { background: var(--bg-subtle); color: var(--text-main); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item.danger:hover { background: #FEF2F2; color: var(--danger); }
.nav-item i { width: 20px; text-align: center; }

/* Main Content */
.main-content { flex: 1; display: flex; flex-direction: column; background: var(--bg-body); }

.top-bar {
    height: 70px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
}

.page-title { font-size: 1.25rem; font-weight: 600; margin: 0; }
.user-menu { display: flex; align-items: center; gap: 1rem; }
.avatar-circle { width: 40px; height: 40px; background: var(--primary-light); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; }

.content-wrapper { flex: 1; overflow-y: auto; padding: 2rem; }

/* --- Components --- */
.card { background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); margin-bottom: 1rem; overflow: hidden; }
.card-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.card-subtitle { margin: 0.25rem 0 0 0; color: var(--text-muted); font-size: 0.9rem; }
.card-body { padding: 1.5rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; color: var(--text-main); }
.form-input, .input {
    width: 100%; padding: 0.75rem 1rem;
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    font-size: 0.95rem; transition: all 0.2s;
    background: var(--bg-card);
}
.form-input:focus, .input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.form-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem; }

.input-group { position: relative; }
.input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-group .form-input { padding-left: 2.75rem; }

.checkbox-label { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; font-size: 0.95rem; }
.checkbox-label input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border-radius: var(--radius-sm);
    font-weight: 500; font-size: 0.95rem; cursor: pointer;
    border: 1px solid transparent; transition: all 0.2s;
    text-decoration: none;
}
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: white; border-color: var(--border-color); color: var(--text-main); }
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--text-muted); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }

.btn-outline { background: transparent; border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { border-color: var(--text-muted); }

.btn-outline-danger { background: transparent; border-color: var(--border-color); color: var(--danger); }
.btn-outline-danger:hover { background: #FEF2F2; border-color: var(--danger); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text-main); }
.btn-icon { padding: 0.5rem; border-radius: 50%; width: 40px; height: 40px; }
.btn-link { background: none; border: none; padding: 0; color: var(--primary); cursor: pointer; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

/* Alerts */
.alert { padding: 1rem; border-radius: var(--radius-sm); display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.95rem; margin-bottom: 1rem; }
.alert-danger, .alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }

/* Grid Helpers */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.grid-sidebar { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-sidebar { grid-template-columns: 280px 1fr; }
}
@media (max-width: 1024px) { .grid-2-1 { grid-template-columns: 1fr; } }

/* Empty State */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { font-size: 3rem; color: var(--text-light); margin-bottom: 1rem; }

/* Tables */
.table, table { width: 100%; border-collapse: collapse; }
.table th, table th { text-align: left; padding: 1rem; border-bottom: 1px solid var(--border-color); color: var(--text-muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; }
.table td, table td { padding: 1rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.table tr:last-child td, table tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-flex; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-3 { margin-top: 0.75rem; }
.w-100 { width: 100%; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.small { font-size: 0.875rem; }

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Avatar */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; }

/* Responsive */
@media (max-width: 768px) {
    .dashboard-layout { flex-direction: column; }
    /* Off-canvas sidebar for mobile */
    .sidebar { position: fixed; left: -100%; top: 0; height: 100dvh; width: 80%; max-width: 320px; border-right: 1px solid var(--border-color); border-bottom: none; box-shadow: var(--shadow-lg); z-index: 1000; transition: left 0.25s ease; }
    body.nav-open .sidebar { left: 0; }
    .sidebar-header { height: 64px; }
    .sidebar-nav { display: block; }
    /* Backdrop when nav open */
    body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 900; }
    .top-bar { position: sticky; top: 0; z-index: 800; }
    #mobileMenuBtn { display: inline-flex !important; }
    .main-content { height: auto; }
    .content-wrapper { padding: 1rem; }
    .grid-2-1 { grid-template-columns: 1fr; }
}

/* Modal / Backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    z-index: 1200;
    padding: 1rem;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    max-width: 720px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.modal-header, .modal-footer { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); display:flex; align-items:center; justify-content:space-between; }
.modal-header { border-bottom: 1px solid var(--border-color); }
.modal-body { padding: 1rem; max-height: 60vh; overflow: auto; }
.modal-footer { border-top: 1px solid var(--border-color); border-bottom: none; }
.modal-backdrop .btn-icon { background: transparent; border: none; }

