/* ===== TYPOGRAPHY & RESET ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Outfit:wght@500;600;700;800&display=swap');

::selection {
    background: rgba(14, 165, 233, 0.28);
    color: #0f172a;
}

:root {
    --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: "Outfit", "DM Sans", sans-serif;
    --bg-void: #020617;
    --bg-deep: #0f172a;
    --accent: #0ea5e9;
    --accent-bright: #38bdf8;
    --accent-glow: rgba(14, 165, 233, 0.45);
    --violet-glow: rgba(139, 92, 246, 0.2);
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border-soft: rgba(148, 163, 184, 0.35);
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 12px 24px -8px rgba(15, 23, 42, 0.1);
    --shadow-elevated: 0 25px 50px -12px rgba(15, 23, 42, 0.28);
    --shadow-glow: 0 0 40px -8px var(--accent-glow);
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --transition: 0.25s var(--ease-out);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse 100% 60% at 50% -15%, rgba(56, 189, 248, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 100% 30%, var(--violet-glow) 0%, transparent 50%),
        radial-gradient(ellipse 40% 35% at 0% 70%, rgba(14, 165, 233, 0.08) 0%, transparent 45%),
        linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-void) 100%);
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: clip;
    max-width: 100%;
}

h1, h2, h3, .page-title, .screen-title, .logo, .stat-value, .tutor-price,
.booking-section-title, .dashboard-student-heading, .auth-brand h2 {
    font-family: var(--font-display);
}

.page-title {
    color: #f8fafc;
    font-size: clamp(1.45rem, 5vw, 2.35rem);
    font-weight: 800;
    margin-bottom: 6px;
    text-align: center;
    letter-spacing: -0.04em;
    line-height: 1.15;
    padding: 0 4px;
    text-shadow: 0 2px 24px rgba(56, 189, 248, 0.35);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .page-title {
        background: linear-gradient(135deg, #ffffff 0%, #bae6fd 45%, #7dd3fc 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        text-shadow: none;
        filter: drop-shadow(0 2px 20px rgba(56, 189, 248, 0.25));
    }
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.01em;
}

/* ===== CONTAINER ===== */
.demo-container {
    width: 100%;
    max-width: min(1140px, 100%);
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    overflow: hidden;
    margin: 20px max(12px, env(safe-area-inset-right)) 40px max(12px, env(safe-area-inset-left));
    position: relative;
}

.demo-container::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(139, 92, 246, 0.12), rgba(14, 165, 233, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.65;
}

/* ===== HEADER & NAV ===== */
.demo-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 42%, #172554 100%);
    color: white;
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    position: relative;
}

.demo-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.5), transparent);
    opacity: 0.7;
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.03em;
}

.logo i {
    color: var(--accent-bright);
    font-size: 1.35rem;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.55));
}

.demo-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.nav-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-btn[disabled]:hover {
    background: rgba(255, 255, 255, 0.07);
}

.nav-btn:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.nav-btn,
.btn-primary,
.btn-secondary,
.auth-tab,
.time-slot {
    touch-action: manipulation;
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
    color: #0f172a;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
}

/* ===== MAIN CONTENT ===== */
.demo-content {
    padding: 40px 44px 48px;
    min-height: 520px;
    position: relative;
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    animation: fadeIn 0.45s var(--ease-out);
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.03em;
}

.screen-title i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(56, 189, 248, 0.08) 100%);
    color: var(--accent);
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.12);
}

.screen-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 28px;
    max-width: 480px;
    line-height: 1.6;
}

/* ===== HERO BANNER ===== */
.hero-banner {
    padding: max(32px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left));
    text-align: center;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.hero-banner::before {
    content: "";
    position: absolute;
    width: min(420px, 90vw);
    height: 180px;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.35) 0%, rgba(139, 92, 246, 0.08) 45%, transparent 70%);
    filter: blur(28px);
    pointer-events: none;
    z-index: 0;
}

.hero-banner .page-title,
.hero-banner .page-subtitle {
    position: relative;
    z-index: 1;
}

/* ===== AUTH LAYOUT ===== */
.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
    max-width: 900px;
}

.auth-brand {
    padding: 20px 0;
}

.auth-brand-icon {
    width: 68px;
    height: 68px;
    background: linear-gradient(145deg, #0ea5e9 0%, #0284c7 40%, #38bdf8 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    margin-bottom: 20px;
    box-shadow: 0 12px 28px rgba(14, 165, 233, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.auth-brand h2 {
    font-size: 1.5rem;
    color: #0f172a;
    margin-bottom: 8px;
}

.auth-brand p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.55;
}

/* ===== ONBOARDING / AUTH ===== */
.onboarding-form {
    max-width: 400px;
    padding: 8px 0;
}

.auth-mode-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    background: linear-gradient(180deg, #eef2f7 0%, #e2e8f0 100%);
    border-radius: 14px;
    padding: 5px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.auth-tab {
    flex: 1;
    padding: 12px 18px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab:hover {
    color: #334155;
}

.auth-tab.active {
    background: white;
    color: var(--accent);
    box-shadow: var(--shadow-card);
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    color: #334155;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2), 0 4px 12px rgba(14, 165, 233, 0.08);
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-group.is-invalid .subject-fieldset {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.subject-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 14px 10px;
    margin: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.subject-fieldset:focus-within {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.subject-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.subject-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s, background 0.15s;
}

.subject-chip:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.subject-chip:has(input:checked) {
    border-color: var(--accent);
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    color: #0c4a6e;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.subject-chip input {
    margin: 0;
    accent-color: #0ea5e9;
}

.form-label-hint {
    font-weight: 500;
    color: #94a3b8;
}

.dashboard-student-prefs {
    margin: 1.25rem 0;
    padding: 1.25rem 1.35rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-card);
}

.dashboard-prefs-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.form-error {
    min-height: 16px;
    margin-top: 6px;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 500;
}

.btn-primary.is-loading {
    opacity: 0.85;
    cursor: wait;
}

.btn-primary.is-loading::after {
    content: '...';
    margin-left: 8px;
}

.auth-switch-text {
    color: #64748b;
    font-size: 0.9rem;
    margin: 16px 0 20px;
}

.auth-link {
    background: none;
    border: none;
    color: #0ea5e9;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
    font-size: inherit;
}

.auth-link:hover {
    color: #0284c7;
}

.auth-error {
    display: none;
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.auth-error.visible {
    display: block;
}

.landing-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.landing-actions .btn-primary,
.landing-actions .btn-secondary {
    width: auto;
    padding: 14px 32px;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
    width: 100%;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary i {
    margin-right: 8px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.95);
    color: var(--accent);
    border: 2px solid rgba(14, 165, 233, 0.45);
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.15);
}

/* ===== SEARCH ===== */
.search-container {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 22px;
    border-radius: var(--radius);
    margin-bottom: 26px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
}

.search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-filter-summary {
    margin-top: 10px;
    color: #475569;
    font-size: 0.85rem;
}

.search-filter-summary strong {
    color: #0f172a;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    border-color: #0ea5e9;
}

.filter-select {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    background: white;
    min-width: 130px;
}

.search-loading,
.search-empty {
    text-align: center;
    padding: 36px 20px;
    color: #64748b;
}

.search-loading i {
    margin-right: 8px;
}

/* ===== TUTOR CARDS ===== */
.tutor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tutor-card {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(226, 232, 240, 0.9);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tutor-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright), #a78bfa);
    opacity: 0;
    transition: opacity var(--transition);
}

.tutor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevated);
    border-color: rgba(14, 165, 233, 0.35);
}

.tutor-card:hover::before {
    opacity: 1;
}

.tutor-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.tutor-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(145deg, #0ea5e9 0%, #0284c7 50%, #38bdf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35), 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.tutor-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.tutor-subject {
    color: #0ea5e9;
    font-weight: 600;
    font-size: 0.8rem;
}

.tutor-rating {
    color: #f59e0b;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.tutor-rating span {
    color: #64748b;
    margin-left: 6px;
}

.tutor-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: #059669;
    margin: 10px 0;
}

.verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
    color: #0f766e;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(45, 212, 191, 0.45);
    box-shadow: 0 2px 6px rgba(20, 184, 166, 0.15);
}

/* ===== PROFILE ===== */
.profile-container {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.profile-sidebar {
    flex: 1;
    min-width: 260px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
}

.profile-main {
    flex: 2;
    min-width: 260px;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(145deg, #0ea5e9 0%, #0284c7 50%, #38bdf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 18px;
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.35), 0 0 0 4px rgba(255, 255, 255, 0.5);
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin: 22px 0;
    padding: 18px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0ea5e9;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
}

.subject-tag {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    padding: 6px 12px;
    border-radius: 9999px;
    margin: 4px 6px 4px 0;
    font-weight: 600;
    font-size: 0.8rem;
}

.review-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: box-shadow var(--transition);
}

.review-card:hover {
    box-shadow: var(--shadow-card);
}

.review-card p {
    color: #64748b;
    line-height: 1.55;
    font-size: 0.9rem;
}

/* ===== BOOKING ===== */
.booking-container {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.calendar-section {
    flex: 1;
    min-width: 260px;
}

.booking-summary {
    flex: 1;
    min-width: 260px;
    background: linear-gradient(165deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 16px;
}

.time-slot {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 12px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
}

.time-slot:hover {
    border-color: #0ea5e9;
}

.time-slot.selected {
    background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.time-slot.unavailable {
    background: #f8fafc;
    color: #94a3b8;
    border-style: dashed;
    cursor: not-allowed;
}

.time-slot.unavailable:hover {
    border-color: #cbd5e1;
}

.time-slot.unavailable small {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
}

.booking-slot-note {
    margin-top: 10px;
    color: #64748b;
    font-size: 0.82rem;
}

.booking-slot-note i {
    margin-right: 6px;
}

.booking-inline-error {
    display: none;
    margin-bottom: 12px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.84rem;
}

.booking-inline-error.visible {
    display: block;
}

.booking-confirmation {
    display: none;
    margin-top: 12px;
    background: #ecfeff;
    color: #0f766e;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.84rem;
}

.booking-confirmation.visible {
    display: block;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.summary-value {
    color: #0f172a;
    font-weight: 600;
}

/* ===== DASHBOARD ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-soft);
    border-left: 4px solid var(--accent);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}

.upcoming-sessions {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-soft);
}

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 14px;
}

.session-item:hover {
    background: #f8fafc;
}

.session-item:last-child {
    border-bottom: none;
}

/* ===== DASHBOARD PROFILE BAR ===== */
.dashboard-profile-bar {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e0f2fe 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.dashboard-profile-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.dashboard-profile-summary > .btn-secondary {
    margin-left: auto;
}

.dashboard-profile-summary .tutor-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.4rem;
}

.verification-pending {
    background: #fef3c7;
    color: #b45309;
}

/* ===== DASHBOARD STUDENT ===== */
.dashboard-student-card {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 55%, #ffffff 100%);
    border-radius: var(--radius);
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: var(--shadow-card), 0 0 40px -12px rgba(14, 165, 233, 0.15);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 100%;
    min-width: 0;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.modal-close:hover {
    color: #0f172a;
}

.modal-content form {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.edit-subjects-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.edit-subjects-chips .subject-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.8;
}

.chip-remove:hover {
    opacity: 1;
    color: #b91c1c;
}

/* ===== FOOTER ===== */
.demo-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 20px;
    padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    font-size: 0.85rem;
    max-width: 100%;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .booking-container {
        flex-direction: column;
    }

    .calendar-section,
    .booking-summary {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    body { padding: 0; }

    .auth-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .auth-brand { padding: 0 0 16px; }

    .auth-brand-icon { margin-bottom: 16px; }

    .demo-container {
        margin: 12px max(12px, env(safe-area-inset-right)) 28px max(12px, env(safe-area-inset-left));
        border-radius: 14px;
    }

    .demo-header {
        padding: 14px max(14px, env(safe-area-inset-right)) 14px max(14px, env(safe-area-inset-left));
        flex-direction: column;
        text-align: center;
    }

    .demo-nav {
        justify-content: center;
        width: 100%;
        gap: 6px;
    }

    .nav-btn {
        flex: 1;
        min-width: 90px;
        min-height: 44px;
        font-size: 0.8rem;
        padding: 10px 12px;
    }

    .demo-content {
        padding: 28px max(20px, env(safe-area-inset-right)) 36px max(20px, env(safe-area-inset-left));
        min-height: 0;
    }

    .screen-title {
        font-size: clamp(1.2rem, 4vw, 1.35rem);
        flex-wrap: wrap;
    }

    .screen-subtitle {
        max-width: none;
    }

    .onboarding-form { padding: 0; }

    .time-slots { grid-template-columns: repeat(2, 1fr); }

    .profile-sidebar { padding: 22px; }

    .profile-container {
        flex-direction: column;
    }

    .tutor-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-profile-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-profile-summary > .btn-secondary {
        margin-left: 0;
        width: 100%;
    }

    .upcoming-sessions {
        padding: 18px 16px;
    }

    .modal-overlay {
        padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    }

    .modal-content {
        max-height: min(90vh, 100dvh - 32px);
    }

    .summary-row {
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    .summary-value {
        text-align: right;
        margin-left: auto;
        word-break: break-word;
    }

    .search-input {
        min-width: 0;
        width: 100%;
    }

    .search-container {
        padding: 18px 16px;
    }

    .dashboard-student-card {
        padding: 32px 18px;
    }

    .dashboard-student-prefs {
        padding: 1rem 1rem;
    }

    .subject-chip {
        font-size: 0.8125rem;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    /* Prevents iOS zoom on focus (inputs below 16px) */
    .form-input,
    .filter-select,
    textarea.form-input {
        font-size: 16px;
    }

    .demo-content {
        padding: 24px max(14px, env(safe-area-inset-right)) 28px max(14px, env(safe-area-inset-left));
    }

    .demo-nav {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 6px;
        gap: 8px;
    }

    .demo-nav .nav-btn {
        flex: 0 0 auto;
        min-width: auto;
    }

    .search-bar { flex-direction: column; }

    .filter-select { width: 100%; }

    .time-slots { grid-template-columns: 1fr; }

    .session-item {
        flex-direction: column;
        align-items: stretch;
    }

    .session-item > .btn-secondary,
    .session-item > a.session-join-link,
    .session-item > .nav-btn {
        width: 100%;
        justify-content: center;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 18px 16px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-secondary {
        width: 100%;
    }

    .booking-pricing__row {
        flex-wrap: wrap;
        gap: 4px 8px;
    }

    .booking-pricing__value {
        margin-left: auto;
    }

    .booking-total-panel__top {
        flex-direction: column;
        align-items: stretch;
    }

    .booking-total-panel__amount {
        margin-left: 0;
        text-align: left;
        width: 100%;
    }

    .modal-overlay {
        align-items: flex-end;
        padding-top: 24px;
    }

    .modal-content {
        border-radius: 16px 16px 0 0;
        max-height: min(88vh, 100dvh - 20px);
    }
}

/* Booking + payment polish */
.booking-calendar-card,
.booking-summary-card {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow-card);
}

.booking-section-title {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.booking-muted {
    color: #64748b;
    font-size: 0.88rem;
}

.booking-loading,
.booking-empty {
    color: #64748b;
    font-size: 0.9rem;
    padding: 0.75rem 0;
}

.booking-slots-heading {
    color: #1f2937;
    margin: 1rem 0 0.5rem;
    font-size: 0.95rem;
}

.booking-session-details {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.booking-session-details .summary-row:last-child {
    margin-bottom: 0;
}

.booking-pricing {
    margin-top: 0.25rem;
}

.booking-pricing__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.booking-pricing__title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}

.booking-pricing__badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #0369a1;
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    border: 1px solid #bae6fd;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.booking-pricing__lines {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
}

.booking-pricing__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.45rem 0;
    font-size: 0.9rem;
}

.booking-pricing__row + .booking-pricing__row {
    border-top: 1px dashed #cbd5e1;
}

.booking-pricing__row--muted .booking-pricing__label,
.booking-pricing__row--muted .booking-pricing__value {
    color: #64748b;
    font-size: 0.85rem;
}

.booking-pricing__label {
    color: #334155;
    font-weight: 500;
}

.booking-pricing__hint {
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.75rem;
}

.booking-pricing__value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

.booking-total-panel {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 1.15rem 1.25rem 1rem;
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 38%, #f0fdf4 100%);
    border: 1px solid #6ee7b7;
    box-shadow:
        0 4px 14px rgba(16, 185, 129, 0.12),
        0 1px 2px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.booking-total-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 16px 0 0 16px;
    background: linear-gradient(180deg, #059669 0%, #10b981 50%, #34d399 100%);
}

.booking-total-panel__top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    padding-left: 0.35rem;
    flex-wrap: wrap;
}

.booking-total-panel__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #047857;
    padding-bottom: 0.2rem;
    flex-shrink: 0;
}

.booking-total-panel__amount {
    font-size: clamp(1.65rem, 4.5vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #065f46;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    margin-left: auto;
    text-align: right;
}

.booking-total-panel__footnote {
    margin: 0.85rem 0 0;
    padding-left: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(5, 150, 105, 0.2);
    font-size: 0.72rem;
    line-height: 1.45;
    color: #047857;
    opacity: 0.9;
}

.booking-footnote {
    text-align: center;
    color: #64748b;
    font-size: 0.82rem;
    margin-top: 1rem;
}

.booking-post-reserve {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.payment-banner {
    display: none;
    margin-bottom: 12px;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.88rem;
    line-height: 1.45;
}

.payment-banner--ok {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border: 1px solid #a7f3d0;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.12);
}

.payment-banner--err {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 1px solid #fecaca;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.1);
}

.status-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
}

.status-badge--pending {
    background: #fffbeb;
    color: #b45309;
}

.status-badge--ok {
    background: #ecfdf5;
    color: #047857;
}

.dashboard-student-bookings {
    margin-top: 1.5rem;
}

.dashboard-student-heading {
    color: #0f172a;
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.dashboard-past-heading {
    margin-top: 1.75rem;
}

.dashboard-bookings-empty {
    margin-bottom: 0;
}

.booking-session-meta {
    margin-top: 8px;
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.booking-session-meta-id {
    font-variant-numeric: tabular-nums;
}

.booking-ref-link {
    font-weight: 600;
    color: #0284c7;
    text-decoration: none;
}

.booking-ref-link:hover {
    text-decoration: underline;
}

.booking-session-highlight {
    outline: 2px solid #0ea5e9;
    outline-offset: 4px;
    border-radius: 12px;
    animation: booking-highlight-pulse 1s ease-out 2;
}

@keyframes booking-highlight-pulse {
    from {
        outline-width: 4px;
        outline-offset: 6px;
        outline-color: rgba(14, 165, 233, 0.35);
    }

    to {
        outline-width: 2px;
        outline-offset: 4px;
        outline-color: rgba(14, 165, 233, 1);
    }
}

.session-join-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.time-slot:focus-visible,
.nav-btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.session-join-link:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* ===== ACCESSIBILITY: respect reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
