/* public/css/styles.css */

:root {
    --primary: #0066cc;
    --primary-hover: #0052a3;
    --success: #10b981;
    --danger: #ef4444;
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

/* -------------------------------------------------------------------------- */
/* UTILITIES */
/* -------------------------------------------------------------------------- */
.hidden { display: none !important; }

.error {
    color: var(--error-text);
    background: var(--error-bg);
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 3px solid var(--error-text);
}

.success {
    color: var(--success-text);
    background: var(--success-bg);
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 3px solid var(--success-text);
}

/* -------------------------------------------------------------------------- */
/* LOGIN / AUTH PAGES (Centered Layout) */
/* -------------------------------------------------------------------------- */
/* Only applies if body has class="auth-page" (we will add this to login.html) */
body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center; /* Default center for auth cards */
}

/* Align forms to left inside the card for better readability */
.login-card form {
    text-align: left;
}

.login-card h2 {
    margin-top: 0;
    color: var(--text-color);
}

.form-group { margin-bottom: 1.25rem; }

label { display: block; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }

input { width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 6px; box-sizing: border-box; font-size: 1rem; }

input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,204,0.15); }

button { padding: 0.75rem 1.5rem; background: var(--primary); color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; transition: 0.2s; width: 100%; }

button:hover { background: var(--primary-hover); }
button.danger { background: var(--danger); }
button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.alert { padding: 1rem; border-radius: 6px; margin-bottom: 1rem; display: none; text-align: center;}
.alert.success { background: #d1fae5; color: #065f46; border: 1px solid #34d399; display: block;}
.alert.error { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; display: block;}

/* 2FA Input Specifics */
.code-input {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

.resend-link {
    display: block;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* DASHBOARD LAYOUT (Navbar + Container) */
/* -------------------------------------------------------------------------- */
/* --- Dynamic Navbar --- */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.nav-btn {
    background: var(--primary);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
}

/* Dashboard Grid */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* Lists (Trusted Devices, Activity Log) */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-details {
    display: flex;
    flex-direction: column;
}

.list-item-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.list-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-sm {
    width: auto;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-danger {
    background-color: var(--error-text);
}
.btn-danger:hover {
    background-color: #bd2130;
}