*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #213547;
    background: #f9fafb;
}

/* Skip link, loading bar, animations, btn transitions: see shared.css */

/* Visually hidden (screen reader only) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
*:focus-visible {
    outline: 2px solid #206bc4;
    outline-offset: 2px;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Public Navbar */
.navbar {
    background: #1e293b;
    padding: 0.75rem 0;
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: #fff;
}

/* Main content */
main {
    padding-top: 1rem;
}

main h2 {
    margin-bottom: 1rem;
}

/* ============ Buttons ============ */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    color: #374151;
    background: #e5e7eb;
}

.btn:hover {
    background: #d1d5db;
}

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

.btn-primary {
    background: #3b82f6;
    color: #fff;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ============ Forms ============ */
input, select, textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-family: inherit;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

/* ============ Alerts ============ */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ============ Login ============ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-box {
    background: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid #c0c4cc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Page entrance - public pages use main */
main {
    animation: page-fade-in 0.25s ease-out;
}

input:not([type="checkbox"]), select, textarea {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nav-links a {
    transition: color 0.15s ease;
}

/* ============ File Upload Area ============ */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}

/* ============ Mobile Touch Optimizations ============ */
@media (max-width: 640px) {
    .container {
        padding: 0 0.75rem;
    }
    main {
        padding-top: 0.5rem;
    }
    /* Larger touch targets for form elements; 16px prevents iOS zoom on focus */
    input, select, textarea {
        padding: 0.625rem 0.75rem;
        font-size: 16px;
    }
    select {
        min-height: 44px;
    }
    label {
        font-size: 0.9rem;
        margin-bottom: 0.35rem;
    }
    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
        font-size: 0.95rem;
    }
    /* Full-width buttons on mobile */
    form .btn[type="submit"] {
        width: 100%;
    }
    .navbar {
        margin-bottom: 1rem;
    }
}
