/* ===== Design Tokens ===== */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-50: rgba(79, 70, 229, 0.08);
    --text: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg: #ffffff;
    --bg-subtle: #f9fafb;
    --bg-muted: #f3f4f6;
    --border: #e5e7eb;
    --border-focus: #4f46e5;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Base ===== */
html {
    font-size: 15px;
    position: relative;
    min-height: 100%;
}
@media (min-width: 768px) {
    html { font-size: 16px; }
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg-subtle);
    margin-bottom: 60px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--primary-hover);
}

/* ===== Focus States ===== */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--primary-50);
    border-color: var(--border-focus);
    outline: none;
}

/* ===== Navbar ===== */
.navbar {
    background: var(--bg) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 0.5rem 0;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.navbar-brand svg {
    flex-shrink: 0;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--text) !important;
    background: var(--bg-muted);
}

.navbar-nav .nav-auth-link {
    color: var(--primary) !important;
    font-weight: 600;
}

.navbar-nav .nav-auth-btn {
    background: var(--primary);
    color: #fff !important;
    border-radius: var(--radius);
    padding: 0.4rem 1rem !important;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition);
    margin-left: 0.25rem;
}
.navbar-nav .nav-auth-btn:hover {
    background: var(--primary-hover);
    color: #fff !important;
}

/* ===== Buttons ===== */
.btn {
    font-weight: 600;
    border-radius: var(--radius);
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover,
.btn-primary:active {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--border);
    background: var(--bg);
}
.btn-outline-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-lg {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
}

/* ===== Form Controls ===== */
.form-control {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--bg);
    color: var(--text);
}
.form-control:hover {
    border-color: #d1d5db;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.form-floating > .form-control {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}
.form-floating > label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ===== Cards ===== */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--bg);
}

/* ===== Auth Layout ===== */
.auth-body {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #c7d2fe 100%);
    margin-bottom: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    justify-content: center;
}

.auth-card {
    width: 100%;
    background: var(--bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem 2rem;
    border: 1px solid rgba(255,255,255,0.7);
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.35rem;
}
.auth-logo:hover {
    color: var(--text);
    text-decoration: none;
}

.auth-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
    text-align: center;
}

.auth-subheading {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    text-align: center;
}

.auth-form .form-floating {
    margin-bottom: 1rem;
}

.auth-form .form-control {
    height: 3rem;
}

.auth-form .btn-primary {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.auth-links a {
    font-weight: 600;
}

.auth-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.75rem 0 0.25rem;
    font-size: 0.875rem;
}
.auth-remember label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
}
.auth-remember a {
    font-size: 0.875rem;
}

.auth-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.auth-footer a {
    color: var(--text-muted);
}
.auth-footer a:hover {
    color: var(--text-secondary);
}

/* ===== Footer ===== */
.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== Nav Pills ===== */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ===== Validation ===== */
.text-danger {
    font-size: 0.8rem;
}

.validation-summary-errors ul {
    margin-bottom: 0;
    padding-left: 1rem;
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 4rem 1rem;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.hero .hero-accent {
    color: var(--primary);
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-actions .btn {
    padding: 0.65rem 1.75rem;
    font-size: 0.95rem;
}

/* ===== Utilities ===== */
.border-top { border-top: 1px solid var(--border) !important; }
.border-bottom { border-bottom: 1px solid var(--border) !important; }
.box-shadow { box-shadow: var(--shadow); }
