* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #f8f8fc;
    color: #1a1a2e;
    min-height: 100vh;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ── Common ── */

.input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e8e8ee;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.input:focus {
    border-color: #6D3AFA;
}

.input-code {
    text-align: center;
    font-size: 24px;
    letter-spacing: 12px;
    font-weight: 700;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: #6D3AFA;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 12px;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background: #fff;
    color: #6D3AFA;
    border: 2px solid #6D3AFA;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-secondary:hover { background: #f5f0ff; }

.btn-outline {
    display: inline-block;
    padding: 12px 24px;
    background: transparent;
    color: #6D3AFA;
    border: 2px solid #e8e8ee;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s;
}

.btn-outline:hover { border-color: #6D3AFA; }

.btn-text {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.btn-text:hover { color: #6D3AFA; }

.btn-cancel {
    width: 100%;
    padding: 10px;
    background: #fff;
    color: #ef4444;
    border: 1.5px solid #fecaca;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s;
}

.btn-cancel:hover { background: #fef2f2; }

.code-hint {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 12px;
}

/* ── Loading ── */

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
    color: #888;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #6D3AFA;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Home page ── */

.home-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.home-hero {
    text-align: center;
    padding: 60px 24px 40px;
    background: linear-gradient(135deg, #6D3AFA 0%, #9B6DFF 100%);
    color: #fff;
    border-radius: 0 0 32px 32px;
}

.home-logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
}

.home-hero h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.home-hero p {
    font-size: 15px;
    opacity: 0.85;
    line-height: 1.5;
}

.home-actions {
    flex: 1;
    padding: 24px 16px;
}

.home-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.home-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.home-card > p {
    color: #888;
    font-size: 14px;
    margin-bottom: 20px;
}

.phone-login, .code-verify {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Master page ── */

.master-header {
    text-align: center;
    padding: 40px 20px 24px;
    background: linear-gradient(135deg, #6D3AFA 0%, #9B6DFF 100%);
    color: #fff;
    border-radius: 0 0 32px 32px;
}

.master-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
}

.master-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.master-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.master-specialty {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.master-address {
    font-size: 13px;
    opacity: 0.7;
}

/* ── Services ── */

.services-section, .verify-section {
    padding: 24px 16px;
}

.services-section h2,
.slots-section h2,
.verify-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 2px solid transparent;
}

.service-card:hover {
    box-shadow: 0 4px 16px rgba(109, 58, 250, 0.12);
    transform: translateY(-1px);
}

.service-card.selected {
    border-color: #6D3AFA;
    background: #f5f0ff;
}

.service-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.service-meta { font-size: 13px; color: #888; }

.service-price {
    font-size: 16px;
    font-weight: 700;
    color: #6D3AFA;
    white-space: nowrap;
}

/* ── Date/time ── */

.slots-section { padding: 0 16px 24px; }

.date-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.date-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #fff;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-days {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}

.date-days::-webkit-scrollbar { display: none; }

.date-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    min-width: 52px;
    transition: background 0.2s;
    border: 2px solid transparent;
}

.date-day.selected { background: #6D3AFA; color: #fff; }
.date-day.today { border-color: #6D3AFA; }
.date-day-name { font-size: 11px; text-transform: uppercase; opacity: 0.6; margin-bottom: 4px; }
.date-day-num { font-size: 16px; font-weight: 600; }

.time-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.time-slot {
    padding: 10px;
    text-align: center;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    border: 2px solid transparent;
}

.time-slot:hover { background: #f0ebff; }
.time-slot.selected { background: #6D3AFA; color: #fff; }
.no-slots { text-align: center; color: #888; padding: 24px; font-size: 14px; }

/* ── Booking form / Verify ── */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    margin-bottom: 6px;
}

.booking-summary {
    background: #f5f0ff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

/* ── Success ── */

.success-screen {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-screen h2 { font-size: 24px; margin-bottom: 12px; }
.success-screen p { color: #666; margin-bottom: 24px; line-height: 1.6; }

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* ── LK ── */

.lk-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.lk-header {
    padding: 40px 16px 24px;
    background: linear-gradient(135deg, #6D3AFA 0%, #9B6DFF 100%);
    color: #fff;
    border-radius: 0 0 32px 32px;
}

.lk-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.lk-top .btn-text { color: rgba(255, 255, 255, 0.7); }
.lk-top .btn-text:hover { color: #fff; }

.lk-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.lk-content {
    flex: 1;
    padding: 16px;
}

.lk-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lk-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #888;
    margin-top: 8px;
    margin-bottom: 4px;
}

.lk-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.lk-card.cancelled { opacity: 0.6; }

.lk-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.lk-card-top strong { font-size: 16px; }
.lk-price { font-weight: 700; color: #6D3AFA; }

.lk-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: #666;
}

.lk-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
}

.lk-badge.cancelled {
    background: #fef2f2;
    color: #ef4444;
}

.lk-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

/* ── Login page ── */

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: #fff;
    border-radius: 24px;
    padding: 40px 24px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.login-card .home-logo {
    color: #6D3AFA;
    margin-bottom: 24px;
}

.login-card h2 {
    font-size: 20px;
    margin-bottom: 24px;
}

/* ── Error ── */

.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-page h1 { font-size: 24px; margin-bottom: 12px; }
.error-page p { color: #888; margin-bottom: 24px; }

/* ── Footer ── */

.booking-footer {
    text-align: center;
    padding: 24px;
    color: #aaa;
    font-size: 13px;
    margin-top: auto;
}

.booking-footer a {
    color: #6D3AFA;
    text-decoration: none;
    font-weight: 600;
}
