@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    /* Herbal Wellness Color Palette */
    --primary: #0F5E48;
    --primary-light: #E9F4F0;
    --primary-hover: #0B4A39;
    --primary-surface: #F2F8F6;
    
    --accent: #C28B38;
    --accent-light: #FBF4E8;
    --accent-hover: #A67328;
    
    --bg-app: #F6F8F7;
    --bg-card: #FFFFFF;
    --bg-subtle: #F0F4F2;
    
    --text-primary: #15221E;
    --text-secondary: #52635D;
    --text-muted: #879993;
    
    --border-color: #E2ECE8;
    --border-focus: #0F5E48;
    
    --success: #10B981;
    --success-light: #ECFDF5;
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --info: #3B82F6;
    --info-light: #EFF6FF;

    /* Elevation & Shadows */
    --shadow-sm: 0 2px 6px rgba(15, 94, 72, 0.04);
    --shadow-md: 0 6px 18px rgba(15, 94, 72, 0.06), 0 2px 6px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 14px 32px rgba(15, 94, 72, 0.09), 0 4px 12px rgba(0, 0, 0, 0.03);
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: 'Prompt', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    padding-bottom: 96px;
    min-height: 100vh;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* App Header & Hero Banner */
.app-header {
    background: linear-gradient(135deg, #0D4E3C 0%, #157359 60%, #1B8869 100%);
    color: #FFFFFF;
    padding: 24px 20px 32px 20px;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 8px 24px rgba(13, 78, 60, 0.18);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -20px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(194, 139, 56, 0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #E6F5F0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 10px 4px 5px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #FFFFFF;
}

.header-title {
    margin-top: 14px;
    position: relative;
    z-index: 2;
}

.header-title h1 {
    font-size: 21px;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: -0.2px;
}

.header-title p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 2px;
}

/* Container */
.container {
    max-width: 580px;
    margin: -16px auto 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 5;
}

/* Step Wizard Navigation */
.stepper-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-subtle);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--border-color);
}

.step-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.step-item.active .step-circle {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 94, 72, 0.18);
}

.step-item.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step-item.completed .step-circle {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
}

.step-item.completed .step-label {
    color: var(--accent);
}

.step-connector {
    position: absolute;
    top: 30px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

/* Card Styles */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 18px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* Service Option Cards */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    gap: 14px;
    align-items: flex-start;
    position: relative;
    user-select: none;
}

.service-card:hover {
    border-color: rgba(15, 94, 72, 0.35);
    background: #FAFDFB;
    transform: translateY(-1px);
}

.service-card.selected {
    border-color: var(--primary);
    background: var(--primary-surface);
    box-shadow: 0 4px 14px rgba(15, 94, 72, 0.08);
}

.service-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.service-card.selected .service-icon-box {
    background: var(--primary);
    color: #FFFFFF;
}

.service-info {
    flex: 1;
}

.service-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.service-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 8px;
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.radio-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    margin-top: 2px;
}

.service-card.selected .radio-check {
    border-color: var(--primary);
    background: var(--primary);
}

.radio-check::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FFFFFF;
    opacity: 0;
    transform: scale(0.5);
    transition: var(--transition);
}

.service-card.selected .radio-check::after {
    opacity: 1;
    transform: scale(1);
}

/* Addon Service Card */
.addon-card {
    background: linear-gradient(135deg, #FFFCF7 0%, #FDF8EE 100%);
    border: 1.5px dashed var(--accent);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 6px;
    margin-bottom: 20px;
    user-select: none;
}

.addon-card:hover {
    background: #FAF3E6;
    border-color: var(--accent-hover);
}

.addon-card.selected {
    background: #F8EED9;
    border-style: solid;
    border-color: var(--accent-hover);
    box-shadow: 0 4px 14px rgba(194, 139, 56, 0.16);
}

.addon-badge {
    background: var(--accent);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Checkbox Check (for Addon) */
.checkbox-check {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    background: #FFFFFF;
}

.checkbox-check .check-icon {
    display: none;
    stroke: #FFFFFF;
}

.addon-card.selected .checkbox-check {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

.addon-card.selected .checkbox-check .check-icon {
    display: block !important;
}

/* Time Slots Grid */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.slot-item {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.slot-item:hover:not(.disabled) {
    border-color: var(--primary);
    background: var(--primary-surface);
}

.slot-item.selected {
    border-color: var(--primary);
    background: var(--primary-surface);
    box-shadow: 0 4px 12px rgba(15, 94, 72, 0.1);
}

.slot-time {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.slot-item.selected .slot-time {
    color: var(--primary);
}

.slot-status {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.slot-status.available {
    background: var(--success-light);
    color: var(--success);
}

.slot-status.almost {
    background: var(--warning-light);
    color: var(--warning);
}

.slot-item.disabled {
    opacity: 0.45;
    background: var(--bg-subtle);
    border-color: var(--border-color);
    cursor: not-allowed;
}

.slot-status.full {
    background: var(--danger-light);
    color: var(--danger);
}

/* Form Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 13px 15px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    background: #FFFFFF;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 94, 72, 0.12);
}

/* Info Note Box */
.notice-box {
    background: #FFF9ED;
    border: 1px solid #FFE7B3;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 16px 0;
}

.notice-icon {
    font-size: 20px;
    color: var(--accent);
    flex-shrink: 0;
    line-height: 1;
}

.notice-text {
    font-size: 13px;
    color: #8C5C12;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #157359 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(15, 94, 72, 0.22);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #0E5944 100%);
    box-shadow: 0 6px 18px rgba(15, 94, 72, 0.3);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #B6C8C1;
    box-shadow: none;
    cursor: not-allowed;
    color: #FFFFFF;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-subtle);
    border-color: var(--text-muted);
}

.btn-block {
    width: 100%;
}

.btn-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-row .btn {
    flex: 1;
}

/* Bottom Floating Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(226, 236, 232, 0.85);
    display: flex;
    justify-content: space-around;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 12px)) 12px;
    z-index: 100;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    gap: 3px;
    padding: 4px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
}

.nav-icon-svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active .nav-icon-svg {
    stroke: var(--primary);
    transform: translateY(-2px);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0px;
    width: 18px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.badge-pending {
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.badge-approved {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}

.badge-rejected {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

.badge-cancelled {
    background: #F3F4F6;
    color: #4B5563;
    border: 1px solid #E5E7EB;
}

/* Loading Overlay */
#liff-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(246, 248, 247, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-spinner {
    width: 46px;
    height: 46px;
    border: 3.5px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin-bottom: 16px;
}

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

.d-none {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Spacing Utilities */
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 20px !important; }
.mt-5 { margin-top: 28px !important; }

.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 20px !important; }
.mb-5 { margin-bottom: 28px !important; }
