/* ============================================
   HERONUSA BOOKING — Design System
   Mobile-first | Honda Red Branding
   ============================================ */

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

/* --- CSS Variables --- */
:root {
    --primary: #CC0000;
    --primary-dark: #990000;
    --primary-light: #FF4444;
    --secondary: #1a1a1a;
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --text-dark: #212529;
    --text-muted: #6c757d;
    --text-light: #ffffff;
    --border: #e0e4e8;
    --success: #28a745;
    --success-light: #d4edda;
    --warning: #ffc107;
    --warning-light: #fff3cd;
    --info: #17a2b8;
    --danger: #dc3545;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --shadow-hover: 0 8px 30px rgba(204,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* --- Header / Navigation --- */
.booking-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.booking-header .logo {
    display: flex;
    justify-content: center;
    flex: 1;
}

.booking-header .logo img {
    height: 32px;
}

.booking-header .header-link {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-body);
}

.booking-header .header-link i {
    font-size: 1.1rem;
}

.booking-header .header-link:hover {
    color: var(--primary);
    background: rgba(204, 0, 0, 0.08);
}

.booking-header .header-spacer {
    width: 40px;
}

/* --- Container --- */
.booking-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: calc(100vh - 60px);
}

.booking-container.wide { max-width: 1000px; }

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    margin-bottom: 24px;
    color: var(--text-light);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.hero-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.hero-section p {
    font-size: 0.9rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* --- Service Type Cards --- */
.service-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.service-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.service-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
}

.service-card .card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    transition: var(--transition);
}

.service-card:hover .card-icon { transform: scale(1.1); }

.service-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.service-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* --- Location Cards --- */
.location-cards { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

.location-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.location-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.location-card.selected {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

.location-card .card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #e9ecef;
}

.location-card .card-body { padding: 16px; }

.location-card .card-body h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.location-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.location-info .info-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.location-info .info-item i {
    color: var(--primary);
    width: 16px;
    text-align: center;
    margin-top: 2px;
    flex-shrink: 0;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-status.open { background: var(--success-light); color: var(--success); }
.badge-status.closed { background: #f8d7da; color: var(--danger); }

.badge-distance {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #e8f4fd;
    color: var(--info);
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
}

.btn-pilih-lokasi {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

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

/* --- Wizard / Progress Steps --- */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    padding: 0 10px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.wizard-step .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.wizard-step.active .step-number {
    background: var(--primary);
    color: white;
}

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

.wizard-step.done .step-number {
    background: var(--success);
    color: white;
}

.wizard-step.done { color: var(--success); }

.wizard-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 6px;
    transition: var(--transition);
}

.wizard-line.active { background: var(--primary); }
.wizard-line.done { background: var(--success); }

/* --- Form Card --- */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.form-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* --- Form Groups --- */
.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-group label .required { color: var(--danger); }

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: var(--transition);
}

.input-icon-wrapper input,
.input-icon-wrapper select,
.input-icon-wrapper textarea {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: var(--text-dark);
    background: var(--bg-card);
    transition: var(--transition);
    outline: none;
}

.input-icon-wrapper select {
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.input-icon-wrapper input:focus,
.input-icon-wrapper select:focus,
.input-icon-wrapper textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.input-icon-wrapper input:focus + i,
.input-icon-wrapper input:focus ~ i { color: var(--primary); }

.input-icon-wrapper textarea {
    min-height: 80px;
    resize: vertical;
}

/* Pin icon to top for textarea — overrides the vertical-center default */
.input-icon-wrapper textarea ~ i {
    top: 14px;
    transform: none;
}

.input-error { border-color: var(--danger) !important; }
.error-text { color: var(--danger); font-size: 0.72rem; margin-top: 4px; display: none; }
.form-group.has-error .error-text { display: block; }

/* --- Time Chips --- */
.time-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.time-chip {
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text-dark);
    text-align: center;
    min-width: 70px;
}

.time-chip:hover:not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.time-chip.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.time-chip.disabled {
    background: #f1f3f5;
    color: #adb5bd;
    border-color: #e9ecef;
    cursor: not-allowed;
    text-decoration: line-through;
}

.time-chip .chip-slots {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 2px;
}

/* --- Summary Card (Confirm Page) --- */
.summary-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.summary-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 16px 20px;
    color: white;
}

.summary-header h2 { font-size: 1rem; font-weight: 700; }

.summary-body { padding: 20px; }

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.summary-row:last-child { border-bottom: none; }

.summary-row .label {
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 40%;
}

.summary-row .value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: right;
    flex: 1;
}

/* --- Success Page --- */
.success-section { text-align: center; padding: 20px 0; }

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--success);
    animation: successPop 0.5s ease-out;
}


@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.booking-code-box {
    background: #f8f9fa;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 20px 0;
}

.booking-code-box .label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }

.booking-code-box .code {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #218838);
    color: white;
}

.btn-success:hover { box-shadow: 0 4px 15px rgba(40,167,69,0.3); }

.btn-wa {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
}

.btn-wa:hover { box-shadow: 0 4px 15px rgba(37,211,102,0.3); }

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

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

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* --- Cek Booking --- */
.cek-booking-result {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}

/* Timeline */
.timeline {
    padding: 20px;
    position: relative;
}

.timeline-item {
    display: flex;
    gap: 14px;
    padding-bottom: 24px;
    position: relative;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 30px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
    z-index: 1;
}

.timeline-item.done .timeline-dot { background: var(--success); color: white; }
.timeline-item.active .timeline-dot { background: var(--primary); color: white; animation: pulse 2s infinite; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(204,0,0,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(204,0,0,0); }
}

.timeline-content h4 { font-size: 0.85rem; font-weight: 600; }
.timeline-content p { font-size: 0.75rem; color: var(--text-muted); }

/* --- Cek Status Link --- */
.cek-status-link {
    text-align: center;
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.cek-status-link a {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.cek-status-link a:hover { text-decoration: underline; }

/* --- Map Container --- */
.map-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 200px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Footer --- */
.booking-footer {
    text-align: center;
    padding: 20px 16px;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.booking-footer a { color: var(--primary); font-weight: 600; }

/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* --- Desktop responsive --- */
@media (min-width: 768px) {
    .booking-container { padding: 32px 20px; }
    .hero-section { padding: 40px 32px; }
    .hero-section h1 { font-size: 1.8rem; }
    .service-cards { gap: 20px; }
    .service-card { padding: 32px 20px; }
    .location-cards { flex-direction: row; }
    .location-card { flex: 1; }
    .form-card { padding: 32px 28px; }
    
    .booking-form-grid {
        display: flex;
        gap: 24px;
        align-items: flex-start;
    }
    .booking-col {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .booking-form-grid .form-card {
        margin-bottom: 0;
    }
    .booking-form-submit {
        width: 100%;
        margin-top: 10px;
    }
}
