/* ===========================================================
   Ava Sani Booking — mobile-only customer booking site.
   A separate design system from the staff admin and the partner
   portal: warm off-white canvas, one coral accent, big rounded cards,
   dark hero landing — built to read as a real consumer app, matching
   the client's reference screenshot's visual language (mirrored for
   RTL: icons/text stay put, but flex/flow direction follows RTL).
   =========================================================== */

:root {
    --accent: #ff6584;
    --accent-dark: #e54f68;
    --accent-soft: #ffe4e9;

    --dark: #17181c;
    --dark-soft: #2a2b31;

    --bg: #ffffff;
    --bg-subtle: #f8f6f5;
    --bg-sunken: #f1eeec;

    --text: #1a1a1e;
    --text-muted: #6b7280;
    --text-faint: #9ca3af;
    --text-on-dark: #ffffff;
    --text-on-dark-muted: #b7b8bd;

    --border: #eeebea;
    --border-strong: #e2dedc;

    --success-bg: #e8f6ee;
    --success-text: #12734a;
    --danger-bg: #fbeaea;
    --danger-text: #a02020;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --radius-full: 999px;

    --shadow-card: 0 4px 20px rgba(23, 24, 28, 0.06);
    --shadow-sticky: 0 -4px 20px rgba(23, 24, 28, 0.08);

    --shell-width: 430px;
    --topbar-height: 56px;
}

* {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: var(--bg-subtle);
    color: var(--text);
    font-family: Vazirmatn, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

h1, h2, h3, p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input {
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ---------------------------------------------------------
   Shell — mobile-only, centered on desktop too
--------------------------------------------------------- */

.booking-shell {
    max-width: var(--shell-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-subtle);
    position: relative;
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .booking-shell {
        min-height: 100vh;
        box-shadow: 0 0 60px rgba(23, 24, 28, 0.08);
    }
}

.booking-topbar {
    height: var(--topbar-height);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.booking-topbar h1 {
    font-size: 16px;
    font-weight: 700;
}

.booking-back {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-sunken);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: var(--text);
}

.booking-back svg {
    width: 18px;
    height: 18px;
    /* the arrow glyph itself points left; RTL "back" means pointing right */
    transform: scaleX(-1);
}

.booking-topbar-spacer {
    width: 36px;
}

.cart-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-sunken);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: var(--text);
}

.cart-icon-btn svg {
    width: 18px;
    height: 18px;
}

.cart-badge {
    position: absolute;
    top: -3px;
    left: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.booking-main {
    flex: 1;
    padding: 20px 16px 100px;
}

.booking-messages {
    margin-bottom: 14px;
}

.booking-message {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    color: var(--danger-text);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ---------------------------------------------------------
   Buttons / inputs
--------------------------------------------------------- */

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-primary:disabled {
    background: var(--border-strong);
    color: var(--text-faint);
    cursor: not-allowed;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.text-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    direction: ltr;
    text-align: center;
    letter-spacing: 1px;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent);
}

.otp-inputs {
    display: flex;
    gap: 10px;
    direction: ltr;
}

.otp-digit {
    width: 100%;
    aspect-ratio: 1;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
}

.otp-digit:focus {
    outline: none;
    border-color: var(--accent);
}

/* ---------------------------------------------------------
   Landing (dark hero)
--------------------------------------------------------- */

.hero {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-soft) 100%);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    padding: 28px 24px 32px;
}

.hero-spacer {
    flex: 1;
    min-height: 40px;
}

.hero-eyebrow {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}

.hero-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 12px;
}

.hero-title strong {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-on-dark-muted);
    line-height: 1.7;
    margin-bottom: 32px;
}

.hero-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hero .text-input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
    text-align: right;
    letter-spacing: normal;
}

.hero .field-label {
    color: var(--text-on-dark-muted);
}

/* ---------------------------------------------------------
   Page header
--------------------------------------------------------- */

.page-header {
    margin-bottom: 18px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-header p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ---------------------------------------------------------
   Service cards
--------------------------------------------------------- */

.service-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow-card);
}

.service-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--bg-sunken);
    flex-shrink: 0;
    object-fit: cover;
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.price-original {
    font-size: 12px;
    color: var(--text-faint);
    text-decoration: line-through;
}

.price-final {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.discount-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 700;
}

.btn-book-small {
    flex-shrink: 0;
    padding: 9px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* ---------------------------------------------------------
   Service detail
--------------------------------------------------------- */

.service-hero-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    object-fit: cover;
    background: var(--bg-sunken);
    margin-bottom: 16px;
}

.service-detail-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.service-detail-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.service-detail-title-row h2 {
    font-size: 18px;
    font-weight: 800;
}

.service-detail-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.spec-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.spec-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.spec-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.section-body {
    font-size: 13px;
    color: var(--text);
    line-height: 1.8;
}

/* ---------------------------------------------------------
   Staff selection
--------------------------------------------------------- */

.staff-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.staff-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-card);
    border: 2px solid transparent;
    cursor: pointer;
    text-align: right;
    width: 100%;
    font-family: inherit;
}

.staff-card.is-selected {
    border-color: var(--accent);
}

.staff-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-sunken);
    flex-shrink: 0;
}

.staff-info {
    flex: 1;
}

.staff-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
}

.staff-specialty {
    font-size: 12px;
    color: var(--text-muted);
}

.staff-check {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-strong);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.staff-check svg {
    opacity: 0;
}

.staff-card.is-selected .staff-check {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.staff-card.is-selected .staff-check svg {
    opacity: 1;
}

/* ---------------------------------------------------------
   Cart
--------------------------------------------------------- */

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.cart-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: var(--shadow-card);
}

.cart-row-info {
    flex: 1;
    min-width: 0;
}

.cart-row-name {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

.cart-row-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.cart-row-price {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.cart-row-remove {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    background: var(--bg-sunken);
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 13px;
}

/* ---------------------------------------------------------
   Summary card (used in cart, confirm)
--------------------------------------------------------- */

.summary-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.summary-line.is-discount {
    color: var(--accent-dark);
}

.summary-line.is-total {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 14px;
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

/* ---------------------------------------------------------
   Sticky bottom bar
--------------------------------------------------------- */

.sticky-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 14px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
    box-shadow: var(--shadow-sticky);
}

.sticky-bar-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.sticky-bar-total strong {
    font-size: 16px;
    color: var(--text);
    font-weight: 800;
}

/* ---------------------------------------------------------
   Date picker
--------------------------------------------------------- */

.date-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.date-pill {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg);
    box-shadow: var(--shadow-card);
    border: 2px solid transparent;
    cursor: pointer;
    min-width: 64px;
    font-family: inherit;
}

.date-pill.is-selected {
    background: var(--accent);
    border-color: var(--accent);
}

.date-pill.is-selected .date-pill-label,
.date-pill.is-selected .date-pill-day {
    color: #fff;
}

.date-pill-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.date-pill-day {
    font-size: 16px;
    font-weight: 800;
}

/* ---------------------------------------------------------
   Time slots
--------------------------------------------------------- */

.slot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.slot-btn {
    padding: 12px 8px;
    border-radius: var(--radius-md);
    background: var(--bg);
    border: 1.5px solid var(--border-strong);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    direction: ltr;
}

.slot-btn.is-selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---------------------------------------------------------
   Success page
--------------------------------------------------------- */

.success-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 8px 20px;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: var(--success-bg);
    color: var(--success-text);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.success-icon svg {
    width: 34px;
    height: 34px;
}

.success-wrap h2 {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 6px;
}

.success-wrap p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.booking-code-pill {
    display: inline-block;
    padding: 8px 18px;
    background: var(--bg-sunken);
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 14px;
    direction: ltr;
    margin-bottom: 24px;
}

/* ---------------------------------------------------------
   Profile / history
--------------------------------------------------------- */

.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-card);
    margin-bottom: 18px;
}

.profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}

.profile-name {
    font-size: 15px;
    font-weight: 800;
}

.profile-mobile {
    font-size: 12px;
    color: var(--text-muted);
    direction: ltr;
    text-align: right;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-row {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-card);
}

.history-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.history-row-code {
    font-size: 12px;
    color: var(--text-faint);
    direction: ltr;
}

.status-pill {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.status-pill.status-confirmed {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-pill.status-pending {
    background: #fdf3e2;
    color: #92600c;
}

.status-pill.status-cancelled {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.status-pill.status-completed {
    background: var(--bg-sunken);
    color: var(--text-muted);
}

.history-row-services {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.history-row-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.logout-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 700;
    background: none;
    border: none;
    width: 100%;
    padding: 10px;
    cursor: pointer;
}

/* ---------------------------------------------------------
   Loading / toast
--------------------------------------------------------- */

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 100;
    max-width: calc(100% - 48px);
    text-align: center;
}
