:root {
    --bg: #0e1015;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-modal: #161920;
    --ink: #1a1d24;
    --ink-inverse: #f0f1f3;
    --muted: #8a8f9e;
    --border: #2a2d36;
    --brand: #3b82f6;
    --brand-hover: #2563eb;
    --brand-glow: rgba(59, 130, 246, 0.15);
    --green: #059669;
    --green-bg: rgba(5, 150, 105, 0.12);
    --red: #7f1d1d;
    --red-bg: rgba(127, 29, 29, 0.15);
    --amber: #b45309;
    --amber-bg: rgba(180, 83, 9, 0.15);
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --radius: 12px;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink-inverse);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* NAV */
.navbar { padding: 1.5rem 0; }
.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--ink-inverse);
}
.logo-mark { width: 32px; height: 32px; border-radius: 8px; }
.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

/* LANGUAGE SWITCHER */
.lang-switcher { display: flex; gap: 6px; }
.lang-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.3s ease;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }
.lang-btn.active { border-color: var(--brand); background: var(--brand-glow); color: var(--brand); }

/* HERO */
.hero {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
.hero-content { max-width: 700px; }
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}
.hero-cta {
    display: inline-block;
    padding: 16px 48px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.3s ease;
}
.hero-cta:hover {
    background: var(--brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.3);
}

/* HERO LINKS */
.hero-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
}
.hero-links a {
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}
.hero-links a:hover { color: var(--brand); }

/* NAV RIGHT */
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-inverse);
}
.btn-outline-sm {
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-outline-sm:hover { border-color: var(--brand); color: var(--brand); }

/* AUTH MODAL */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-tab.active {
    background: var(--brand);
    color: #fff;
}
.auth-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    min-height: 1em;
}

/* PASSWORD TOGGLE */
.password-wrap {
    position: relative;
}
.password-wrap input {
    padding-right: 44px;
}
.pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pw-toggle:hover { color: var(--ink-inverse); }
.pw-toggle svg {
    width: 18px;
    height: 18px;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-sm { max-width: 480px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
}
.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* TIMETABLE NAV */
.timetable-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.timetable-nav-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--ink-inverse);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.timetable-nav-btn:hover { border-color: var(--brand); color: var(--brand); }
.timetable-week {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--muted);
}

/* LEGEND */
.timetable-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: var(--muted);
}
.timetable-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.legend-dot.available { background: var(--green); }
.legend-dot.unavailable { background: #334155; }
.legend-dot.requested { background: var(--amber); }

/* TIMETABLE GRID */
.timetable-grid { overflow-x: auto; }
.timetable-loading {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
}

.timetable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.timetable th {
    padding: 10px 8px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    text-align: center;
}
.timetable td {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid rgba(42, 45, 54, 0.4);
}
.timetable .time-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
    text-align: right;
    padding-right: 12px;
    width: 70px;
}
.timetable .section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand);
    padding: 12px 8px 6px;
    text-align: left;
}

.slot {
    width: 100%;
    height: 38px;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.slot.available {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(5, 150, 105, 0.2);
}
.slot.available:hover {
    background: var(--green);
    color: #fff;
    transform: scale(1.05);
}
.slot.unavailable {
    background: rgba(51, 65, 85, 0.15);
    color: #475569;
    cursor: default;
}
.slot.requested {
    background: var(--amber-bg);
    color: var(--amber);
    border: 1px solid rgba(180, 83, 9, 0.2);
    cursor: default;
}
.slot.past {
    background: rgba(51, 65, 85, 0.08);
    color: #334155;
    cursor: default;
}

/* BOOKING FORM */
.booking-slot-label {
    background: var(--brand-glow);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--brand);
    text-align: center;
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink-inverse);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--brand); }
.form-group input::placeholder { color: #555; }
.form-group select { cursor: pointer; }
.form-group select option { background: var(--bg-modal); color: var(--ink-inverse); }

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 1.5rem;
}
.btn-outline {
    padding: 10px 20px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--ink-inverse); color: var(--ink-inverse); }
.btn-primary {
    padding: 10px 24px;
    background: var(--brand);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary:hover { background: var(--brand-hover); }

/* TOAST */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--green);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.error { background: #dc2626; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .timetable { font-size: 0.75rem; }
    .timetable th { font-size: 0.65rem; padding: 8px 4px; }
    .slot { height: 34px; font-size: 0.7rem; }
    .timetable .time-label { font-size: 0.65rem; width: 55px; }
    .modal { padding: 1.5rem; }
}
