/* public/css/styles.css */

:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #ddd;
    --error-bg: #ffe6e6;
    --error-text: #dc3545;
    --success-bg: #d4edda;
    --success-text: #155724;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex; 
    flex-direction: column;  /* <--- ADDS VERTICAL STACKING */
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    background: #f4f6f8; 
    margin: 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: 500;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

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

button:hover {
    background: var(--primary-hover);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 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) */
/* -------------------------------------------------------------------------- */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.brand {
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.nav-links button {
    width: auto;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.nav-links button:hover {
    background: #f8f9fa;
    color: var(--text-color);
}

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

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

.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.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;
}