/*
 * ExclusIV Med — Shared design tokens & site-chrome
 * Loaded on every page. Page-specific styles still live inline.
 */

/* ---------- Design tokens ---------- */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-tertiary: #f0f2f4;
    --bg-card: #ffffff;
    --bg-warm: #faf9f7;
    --bg-cream: #f5f4f1;
    --bg-eggshell: #f8f7f4;
    --bg-warm-dark: #ebe6df;
    --bg-cream-dark: #e6dfd5;
    --accent: #0b57d0;
    --accent-contrast: #0a3ea1;
    --accent-warm: #8b7355;
    --accent-warm-dark: #6b5540;
    --accent-soft: #a69b8c;
    --text-primary: #111111;
    --text-secondary: #5b5f65;
    --text-muted: #8a8f96;
    --text-warm: #6b5d47;
    --border-color: #e6e8eb;
    --border-warm: #e8e2d9;
    --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.06);
    --shadow-warm: 0 6px 20px rgba(139, 115, 85, 0.08);
    --shadow-intense: 0 16px 40px rgba(17, 17, 17, 0.12), 0 4px 12px rgba(139, 115, 85, 0.08);
    --bg-footer: #111111;
    --text-footer: #f5f5f5;
    --text-footer-muted: #888888;
}

/* ---------- Accessibility ---------- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--text-primary);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 0 0 8px 0;
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .fade-up { opacity: 1 !important; transform: none !important; }
}

/* ---------- Auth section in header ---------- */
.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 0.75rem;
}

.sign-in-button {
    background: var(--bg-primary);
    border: 1px solid var(--border-warm);
    color: var(--text-secondary);
    padding: 0.6rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sign-in-button:hover {
    border-color: var(--accent-warm);
    color: var(--accent-warm);
    transform: translateY(-2px);
}

.user-menu {
    position: relative;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--accent-warm);
    transition: transform 0.2s;
}
.user-avatar:hover {
    transform: scale(1.1);
}
.user-dropdown {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    padding: 1rem;
    min-width: 220px;
    box-shadow: var(--shadow-soft);
    z-index: 100;
}
.user-dropdown.active {
    display: block;
}
.user-info {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-warm);
    margin-bottom: 0.75rem;
}
.user-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.user-email {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.dropdown-item {
    display: block;
    padding: 0.75rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    text-align: center;
}
.dropdown-item:hover {
    color: var(--accent-warm);
}
.sign-out-button {
    width: 100%;
    background: var(--bg-warm);
    border: 1px solid var(--border-warm);
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    margin-top: 0.5rem;
}
.sign-out-button:hover {
    background: var(--accent-warm);
    color: white;
    border-color: var(--accent-warm);
}

/* ---------- Booking / Auth modal (hidden by default!) ---------- */
.booking-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 1rem;
}
.booking-modal.active {
    display: flex;
    opacity: 1;
}

.booking-modal-content {
    background: var(--bg-primary);
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: scale(0.96);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.booking-modal.active .booking-modal-content {
    transform: scale(1);
}

.booking-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.booking-title {
    font-size: 1.35rem;
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.close-modal {
    background: var(--bg-secondary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: inherit;
}
.close-modal:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.booking-form {
    padding: 1.5rem 2rem 2rem;
}

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

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    background: var(--bg-warm);
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text-primary);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-warm);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15);
    background: var(--bg-primary);
}
.form-input-static {
    padding: 0.85rem 1rem;
    background: var(--bg-warm);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0;
}

.booking-submit {
    width: 100%;
    background: var(--accent-warm);
    color: white;
    border: none;
    padding: 0.95rem 1.25rem;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.booking-submit:hover {
    background: var(--accent-warm-dark);
    transform: translateY(-1px);
}
.booking-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-message {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: none;
}
.auth-message:not(:empty) {
    display: block;
}
.auth-message.success {
    background: #e8f4ea;
    color: #1f6b32;
    border: 1px solid #b8dec1;
}
.auth-message.error {
    background: #fdecea;
    color: #a23a2c;
    border: 1px solid #f4c2bc;
}

.auth-toggle-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.auth-toggle-link a {
    color: var(--accent-warm);
    text-decoration: none;
    font-weight: 600;
}
.auth-toggle-link a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .booking-modal {
        padding: 0;
        align-items: flex-end;
    }
    .booking-modal-content {
        max-width: 100%;
        width: 100%;
        border-radius: 24px 24px 0 0;
        max-height: 90vh;
    }
    .booking-header { padding: 1.25rem 1.5rem; }
    .booking-form { padding: 1.25rem 1.5rem 1.5rem; }
}
