@font-face { font-family: 'Work Sans'; src: url('../fonts/work-sans-latin.woff2') format('woff2'); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2'); font-style: normal; font-weight: 100 800; font-display: swap; }

:root {
    font-family: 'Work Sans', system-ui, sans-serif;
    color: #1c1c1c;
    background: #faf8f4;
    font-synthesis: none;
}

#blazor-error-ui { display: none; }
.blazor-error-boundary { padding: 16px; background: #b3261e; color: white; }
.loading-progress { position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; transform: translate(-50%, -50%) rotate(-90deg); }
.loading-progress circle { fill: none; stroke: #e0dbd3; stroke-width: 7%; }
.loading-progress circle:last-child { stroke: #1c1c1c; stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%)), 500%; transition: stroke-dasharray .2s ease; }
.loading-progress-text { display: none; }

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; }
body { margin: 0; background: #faf8f4; }
button, input { font: inherit; }
button { color: inherit; transition: transform 120ms ease-out, background-color 120ms ease-out; }
button:active, .choice:active { transform: scale(.98); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #3f7d58; outline-offset: 2px; }

.app-shell {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 22px 112px;
    background: #faf8f4;
}

.app-shell:has(.login-shell) { padding: 0; }

.eyebrow {
    font: 400 10px/1.2 'JetBrains Mono', monospace;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #8a8a8a;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.title {
    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.03em;
}

.hero-title { font-size: 34px; }
.subtitle, .muted { color: #8a8a8a; }
.subtitle { margin: 0 0 24px; font-size: 14px; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.two { display: flex; gap: 10px; }
.two > * { flex: 1; }

.card, .service-card, .staff-card {
    background: #fff;
    border: 1px solid #e0dbd3;
    border-radius: 18px;
    padding: 16px;
}

.choice { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.card.choice { border: 1px solid #e0dbd3; }
.dashed { border: 1px dashed #ded8ce !important; background: transparent; text-align: center; color: #8a8a8a; padding: 20px; }

.app-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block; }
.barber-photo { flex: 0 0 58px; width: 58px; height: 58px; border-radius: 50%; object-fit: cover; display: block; }

.chair.card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-height: 112px;
    text-align: left;
}
.chair.card:active { background: #f6f3ee; }
.name { font-size: 17px; font-weight: 700; }
.chair .muted, .chair .next { display: inline-block; font-size: 12px; line-height: 1.55; }
.next, .success { color: #3f7d58; font-weight: 600; }
.chevron { margin-left: auto; color: #c3bdb2; font-size: 20px; line-height: 1; }

.booking-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 74px;
    margin: -28px -22px 28px;
    border-bottom: 1px solid #efeae2;
    padding: 0 22px;
}
.back-button { position: absolute; left: 14px; width: 44px; height: 44px; border: 0; background: transparent; color: #8a8a8a; font-size: 28px; }
.booking-barber { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.booking-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.booking-section { margin-bottom: 28px; }
.service-section { margin-bottom: 18px; }
.service-stack { margin-top: 10px; gap: 12px; }

.service-card {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    color: #1c1c1c;
    text-align: left;
    cursor: pointer;
}
.service-card b { font-size: 16px; }
.service-card .muted { display: inline-block; margin-top: 3px; font-size: 12px; }
.service-card.selected { border: 2px solid #1c1c1c; padding: 15px; }

.days { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
    flex: 1 0 62px;
    min-width: 62px;
    min-height: 66px;
    border: 1px solid #e0dbd3;
    border-radius: 14px;
    background: #fff;
    padding: 10px 0;
    text-align: center;
}
.day small { color: #8a8a8a; font-size: 10px; }
.day b { font-size: 18px; }
.day.active { border-color: #1c1c1c; background: #1c1c1c; color: #faf8f4; }
.day.active small { color: #faf8f4; }

.times-section { padding-bottom: 92px; }
.times-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.times-heading .muted { font-size: 13px; }
.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot { min-height: 46px; border: 1px solid #e0dbd3; border-radius: 14px; background: #fff; padding: 13px 0; font-size: 14px; font-weight: 600; }
.slot.selected { border: 2px solid #1c1c1c; padding: 12px 0; }
.empty-times { margin: 0; padding: 30px 0; color: #8a8a8a; text-align: center; font-size: 14px; }

.footer-cta {
    position: fixed;
    z-index: 3;
    right: 0;
    bottom: 75px;
    left: 0;
    width: 100%;
    max-width: 480px;
    margin: auto;
    border-top: 1px solid #efeae2;
    background: #faf8f4;
    padding: 16px 22px 18px;
}
.primary {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 16px;
    background: #1c1c1c;
    color: #fff;
    padding: 16px;
    font-weight: 700;
    cursor: pointer;
}
.primary:disabled { opacity: .35; cursor: not-allowed; }
.secondary-button, .outline-button, .quiet-button, .sheet-cancel {
    min-height: 44px;
    border-radius: 13px;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.secondary-button, .outline-button { border: 1px solid #1c1c1c; background: #fff; }
.quiet-button, .sheet-cancel { border: 1px solid #e0dbd3; background: #fff; color: #8a8a8a; }

.tabbar {
    position: fixed;
    z-index: 6;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 480px;
    min-height: 76px;
    margin: auto;
    border-top: 1px solid #efeae2;
    background: #faf8f4;
    padding: 12px 22px 20px;
}
.tab-link { flex: 1; color: #b3aca1; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; }
.tab-link svg { width: 22px; height: 22px; fill: none; stroke: #d8d3ca; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-link.active { color: #1c1c1c; font-weight: 600; }
.tab-link.active svg { stroke: #1c1c1c; }

.sheet-backdrop { position: fixed; z-index: 8; inset: 0; background: rgba(28, 28, 28, .35); animation: fade-in 260ms ease-out; }
.sheet {
    position: fixed;
    z-index: 9;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    margin: auto;
    overflow-y: auto;
    border-radius: 26px 26px 0 0;
    background: #fff;
    box-shadow: 0 -12px 40px rgba(28, 28, 28, .14);
    padding: 20px 22px 28px;
    animation: sheet-up 260ms cubic-bezier(.32, .72, 0, 1);
}
.handle { width: 44px; height: 5px; margin: 0 auto 20px; border-radius: 3px; background: #e0dbd3; }
.sheet-title { margin: 0 0 22px; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.summary-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.summary-row { display: flex; justify-content: space-between; gap: 20px; font-size: 14px; }
.summary-row span { color: #8a8a8a; }
.summary-row b { text-align: right; }
.summary-total { border-top: 1px solid #efeae2; padding-top: 14px; font-size: 17px; }
.confirm-sheet { padding-bottom: 8px; }
.confirm-sheet .quiet-button { width: 100%; min-height: 32px; margin-top: 2px; border: 0; background: transparent; color: #8a8a8a; }
.confirm-sheet .summary-list { gap: 10px; margin-bottom: 12px; }
.confirm-sheet .summary-total { padding-top: 12px; }
.booking-error, .form-error { margin: 0; color: #b06a6a; font-size: 13px; }

.field { width: 100%; min-height: 50px; border: 1px solid #e0dbd3; border-radius: 14px; background: #fff; padding: 15px; color: #1c1c1c; font-size: 15px; }
.field::placeholder { color: #8a8a8a; }
.field-group { display: flex; flex-direction: column; gap: 7px; }
.form-actions { display: flex; gap: 12px; }
.form-actions .primary { flex: 1; }
.form-actions .sheet-cancel { flex: 0 0 110px; }
.delete-button { width: 100%; border: 0; background: transparent; color: #b06a6a; padding: 8px; font-size: 13px; }

.login-shell { min-height: 100vh; display: flex; flex-direction: column; background: #1c1c1c; color: #faf8f4; padding: 70px 22px 0; }
.login-hero { flex: 1; }
.login-title { margin: 34px 0 40px; font-size: 36px; line-height: 1.08; letter-spacing: -.03em; }
.login-sheet { margin: auto -22px 0; border-radius: 26px 26px 0 0; background: #faf8f4; color: #1c1c1c; padding: 26px 22px 28px; }
.login-sheet h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: -.02em; }
.login-intro { margin: -4px 0 18px; color: #8a8a8a; font-size: 13px; line-height: 1.45; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.password-field { letter-spacing: .2em; }
.auth-switch { width: 100%; margin-top: 18px; border: 0; background: transparent; color: #3f7d58; padding: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.auth-switch-tight { margin-top: 0; }
.verification-code { text-align: center; font: 700 22px 'JetBrains Mono', monospace; letter-spacing: .45em; padding-left: calc(15px + .45em); }
.verification-hint { margin: 0 2px; color: #8a8a8a; font-size: 12px; line-height: 1.45; }
.verification-resend { width: 100%; }
.form-notice { margin: 0; color: #3f7d58; font-size: 13px; }
.demo-accounts { margin-top: 18px; border-top: 1px solid #efeae2; padding-top: 14px; }
.demo-account { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; border: 0; background: transparent; padding: 8px 0; }
.demo-account code { color: #5d5b57; font: 400 12px 'JetBrains Mono', monospace; }
.demo-disclaimer { color: #b3aca1; font-size: 11px; }

.pill { display: inline-flex; align-items: center; border-radius: 999px; background: #eaf2ed; color: #3f7d58; padding: 5px 10px; font-size: 11px; font-weight: 600; }
.pill.neutral { background: #f1ede6; color: #5d5b57; }

.visit-success { margin-top: 48px; }
.success-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 38px; border-radius: 50%; background: #3f7d58; color: #fff; font-size: 28px; animation: success-pop 220ms ease-out; }
.visit-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.visit-card-head, .visit-barber, .service-card-head, .service-meta, .staff-name-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.visit-card-head b { font-size: 18px; }
.visit-barber { justify-content: flex-start; }
.visit-barber img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.past-section, .hours-section, .stats-section { margin-top: 28px; }
.past-row, .hours-row { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #efeae2; padding: 15px 0; }
.next-visit-card { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.next-visit-card b { font-size: 14px; }
.next-visit-card .muted { font-size: 12px; }
.next-visit-card a { color: #3f7d58; font-size: 12px; font-weight: 600; text-decoration: none; }
.empty-state { padding: 40px 0; color: #8a8a8a; text-align: center; font-size: 14px; }

.agenda-summary { margin-bottom: 18px; }
.agenda-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.agenda { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; border-radius: 16px; padding: 14px; }
.agenda-time { font: 500 13px 'JetBrains Mono', monospace; }
.agenda-time small { color: #b3aca1; font-size: 10px; }
.agenda-details { border-left: 1px solid #efeae2; padding-left: 14px; }
.agenda-details b { font-size: 14px; }
.agenda-details span { color: #8a8a8a; font-size: 12px; }
.open-agenda { border: 1px dashed #ded8ce; background: transparent; color: #b3aca1; padding: 18px 14px; }
.open-agenda .agenda-details { border-left-color: #ded8ce; }

.service-manage-card { display: flex; flex-direction: column; gap: 12px; }
.service-description { margin: 3px 0 0; color: #8a8a8a; font-size: 12px; }
.service-meta { justify-content: flex-start; }
.service-edit { margin-left: auto; border: 0; background: transparent; font-weight: 600; }
.hours-row { font-size: 14px; }
.hours-row span:last-child { color: #8a8a8a; }

.staff-card { display: flex; align-items: center; gap: 14px; }
.staff-card img { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.staff-card .muted { display: block; margin-top: 4px; font-size: 12px; }
.stats-grid { display: flex; gap: 12px; margin-top: 10px; }
.stat-card { flex: 1; }
.stat-card b { font-size: 26px; letter-spacing: -.02em; }
.stat-card span { color: #8a8a8a; font-size: 12px; }
.account-card { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.account-link { display: grid; place-items: center; color: #1c1c1c; text-decoration: none; }

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes success-pop { from { transform: scale(.85); } to { transform: scale(1); } }

@media (max-width: 480px) {
    .app-shell { padding-top: 42px; }
    .app-shell:has(.login-shell) { padding-top: 0; }
    .booking-header { margin-top: -42px; }
}

@media (min-width: 641px) {
    .app-shell { border-right: 1px solid #e0dbd3; border-left: 1px solid #e0dbd3; }
}
