/* Color Palette & Variables */
:root {
    --forest-green: #1A1B5D;
    --hero-bg-image: none; /* Set dynamically via JS */
    --seafoam: #e0f2f1;
    --mint: #8E979E;
    --accent-orange: #f47932;
    --text-main: #333;
    --text-light: #666;
    --bg-gray: #f4f7f6;
    --white: #ffffff;
}

body {
    font-family:
        "Segoe UI",
        system-ui,
        -apple-system,
        sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    color-scheme: light;
    color-scheme: light;
    color-scheme: light;
    color-scheme: light;
    color-scheme: light;
    color-scheme: light;
}

/* Layout Logic */
.split-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Hero Image Section */
.hero-sidebar {
    height: 300px;
    /* background-image: url("https://images.unsplash.com/photo-1542314831-068cd1dbfeeb?auto=format&fit=crop&q=80&w=1200"); */
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Per-resort hero backgrounds — add a BEM modifier class matching the resort code */

/* Brand backgrounds */
.hero-sidebar--vrs,
.hero-sidebar--rhs {
    background-color: var(--white);
}

/* Logo inside the hero sidebar — centered */
.hero-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: 154px;
    width: auto;
    z-index: 10;
}

/* Crystal Springs */
.hero-sidebar--8 {
    background-image: url("https://images.propcal.co.za/images/8/1024/6.jpg");
}
/* Manzi Monate */
.hero-sidebar--128 {
    background-image: url("https://images.propcal.co.za/images/128/1024/MANMON9.jpg");
}

/* Mount Amanzi */
.hero-sidebar--131 {
    background-image: url("https://images.propcal.co.za/images/131/1024/MA22.jpg");
}

/* Doornkop */
.hero-sidebar--201 {
    background-image: url("https://images.propcal.co.za/images/201/1024/Doornkop5.jpg");
}

.banner-expired {
  background-image: url("/images/background-expired.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.hero-text h2 {
    color: white;
    margin: 0;
    font-size: 1.8rem;
}

.hero-text p {
    color: rgba(255, 255, 255, 0.9);
    margin: 5px 0 0;
}

/* Form Content Area */
.form-content-area {
    padding: 20px;
}

.form-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

/* Header & Typography */
.form-header {
    margin-bottom: 30px;
}

.brand-subtitle {
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--forest-green);
    font-weight: 800;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

h1 {
    font-size: 2.2rem;
    margin: 0;
    color: var(--forest-green);
}

.intro-text {
    color: var(--text-light);
    margin-top: 10px;
}

/* Card Components */
.card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card h2,
.card h3 {
    margin: 0;
    color: var(--forest-green);
    font-size: 1.25rem;
}

.booking-id {
    font-weight: bold;
    color: var(--forest-green);
    background: var(--seafoam);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Grid Layout */
.grid-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    margin-top: 6px;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.read-only {
    background: var(--bg-gray);
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid #e0e0e0;
}

input[type="tel"] {
    width: 100%;
    border: 2px solid var(--seafoam);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s;
    color: var(--forest-green);
    background: var(--seafoam);
    margin-bottom: 6px;
}

input[type="tel"]:focus {
    border-color: var(--mint);
    outline: none;
    color: var(--forest-green);
    background: var(--seafoam);
}

input[type="text"] {
    width: 100%;
    border: 2px solid var(--seafoam);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s;
    color: var(--forest-green);
    background: var(--seafoam);
    margin-bottom: 6px;
}

input[type="text"]:focus {
    border-color: var(--mint);
    outline: none;
    color: var(--forest-green);
    background: var(--seafoam);
}

input[type="email"] {
    width: 100%;
    border: 2px solid var(--seafoam);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s;
    color: var(--forest-green);
    background: var(--seafoam);
    margin-bottom: 6px;
}

input[type="email"]:focus {
    border-color: var(--mint);
    outline: none;
    color: var(--forest-green);
    background: var(--seafoam);
}

input[type="select"] {
    width: 100%;
    border: 2px solid var(--seafoam);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s;
    color: var(--forest-green);
    background: var(--seafoam);
    margin-bottom: 6px;
}

input[type="select"]:focus {
    border-color: var(--mint);
    outline: none;
    color: var(--forest-green);
    background: var(--seafoam);
}

select {
    appearance: none;
    width: 100%;
    border: 2px solid var(--seafoam);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s;
    color: var(--forest-green);
    background: var(--seafoam);
    margin-bottom: 6px;
    /* Add a custom SVG arrow */
    background-image: url('/images/arrow-down-angle.svg');
    padding-right: 36px; /* Space for the arrow */
    /* background-image: url("data:image/svg+xml,%3Csvg xmlns='http://w3.org' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); */
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px; 
}

/* Specialty Styles */
.alert-border {
    border-top: 4px solid var(--accent-orange);
}

.error-msg {
    color: var(--accent-orange);
    font-size: 0.8rem;
    margin-top: 6px;
    display: block;
    font-weight: 600;
}

/* Checkboxes */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-container input {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: var(--forest-green);
}

/* Voucher Promo */
.voucher-card {
    background: linear-gradient(135deg, #f47932, #ff9a5c);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.voucher-card h3 {
    margin: 0 0 10px 0;
    color: white;
}
.voucher-card p {
    font-size: 0.9rem;
    margin: 10px 0 0 0;
}

/* Action Button */
.btn-submit {
    width: 100%;
    background-color: var(--forest-green);
    color: white;
    padding: 20px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(45, 90, 39, 0.2);
    transition:
        transform 0.2s,
        background 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
}

.button-primary:disabled {
    background-color: #1A1B5D;
    opacity: 0.4;
    cursor: not-allowed;
}

/* Desktop Media Query */
@media (min-width: 1024px) {
    .split-container {
        flex-direction: row;
        height: 100vh;
        overflow: hidden;
    }

    .hero-sidebar {
        flex: 1;
        height: 100%;
    }

    .form-content-area {
        flex: 1.2;
        overflow-y: auto;
        padding: 60px 40px;
    }

    .overlay {
        padding: 60px;
    }

    .hero-text h2 {
        font-size: 3rem;
    }
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* Compact Booking Summary */
.booking-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-left: 4px solid var(--forest-green);
    border-radius: 10px;
    padding: 0.75rem 1.1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.booking-summary__main {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.booking-summary__name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--forest-green);
}

.booking-summary__resort {
    font-size: 0.8rem;
    color: var(--text-light);
}

.booking-summary__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.booking-summary__dates {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 600;
    white-space: nowrap;
}

/* Contact Details in Step 2 */
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.contact-details__item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.contact-details__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    flex-shrink: 0;
}

.contact-details__value {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    text-align: right;
}

/* Step Wizard Stepper */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.stepper-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    border: 3px solid #e0e0e0;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.stepper-circle--active {
    background-color: var(--forest-green);
    color: #fff;
    border-color: var(--forest-green);
    box-shadow: 0 0 0 4px rgba(26, 27, 93, 0.15);
}

.stepper-label {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #aaa;
    transition: color 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stepper-label--active {
    color: var(--forest-green);
}

.stepper-track {
    flex: 1;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    margin: 0 0.75rem 1.4rem;
    overflow: hidden;
}

.stepper-progress {
    height: 100%;
    background-color: var(--forest-green);
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* Document overlay container */
.doc-container {
    height: 83.333%;
    width: 80%;
    padding: 3rem;
}
@media (max-width: 1024px) {
    .doc-container {
        width: 83.333%;
        padding: 1.25rem;
    }
}

/* Page transitions */
.smooth {
    animation: 420ms linear 90ms both fade-in, 300ms linear both slide-from-right;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes slide-from-right { from { transform: translateX(90px); } }
@keyframes slide-to-left { to { transform: translateX(-90px); } }
.slide-bookings { view-transition-name: slide-bookings; }
::view-transition-old(slide-bookings) {
    animation: 180ms cubic-bezier(0.4,0,1,1) both fade-out, 600ms cubic-bezier(0.4,0,0.2,1) both slide-to-left;
}
::view-transition-new(slide-bookings) {
    animation: 420ms cubic-bezier(0,0,0.2,1) 90ms both fade-in, 600ms cubic-bezier(0.4,0,0.2,1) both slide-from-right;
}

/* Typography */
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }
.underline { text-decoration: underline; }
.leading-tight { line-height: 1.25; }
.leading-none { line-height: 1; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-md { font-size: 1rem; }
.text-xl { font-size: 1.25rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.text-8px { font-size: 8px; }
.text-10px { font-size: 10px; }
.align-top { vertical-align: top; }

/* Colors */
.text-white { color: #fff; }
.text-gray-600 { color: #4b5563; }
.text-gray-800 { color: #1f2937; }
.text-orange-700 { color: #c2410c; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-green-700 { color: #15803d; }

/* Backgrounds */
.bg-teal-100 { background-color: #ccfbf1; }
.bg-white { background-color: #fff; }
.bg-orange-100 { background-color: #ffedd5; }
.bg-green-100 { background-color: #dcfce7; }
.bg-indigo-950 { background-color: #1e1b4b; }

/* Borders */
.border { border: 1px solid #e5e7eb; }
.border-l-4 { border-left: 4px solid; }
.border-orange-500 { border-color: #f97316; }
.border-red-500 { border-color: #ef4444; }
.border-green-500 { border-color: #22c55e; }
.rounded { border-radius: 12px; }

/* Display & positioning */
.hidden { display: none; }
.block { display: block; }
.relative { position: relative; }
.overflow-y-auto { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
.float-right { float: right; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.m-auto { margin: auto; }
.h-screen { height: 100vh; }
.h-dvh { height: 100dvh; }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }

/* Icon + content row widths */
.w-5 { width: 1.25rem; min-width: 1.25rem; }
.w-95 { width: calc(100% - 1.25rem); }

/* Spacing (supplementing OAT's mt-2, mt-4, mt-6, mb-2, mb-4, mb-6, p-4, gap-1, gap-2, gap-4) */
.mt-1 { margin-top: 0.25rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-12 { margin-top: 3rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.ml-12 { margin-left: 3rem; }
.mr-12 { margin-right: 3rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.gap-3 { gap: 0.75rem; }
.p-1 { padding: 0.25rem; }
.p-3 { padding: 0.75rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* HTMX indicator */
.htmx-indicator { display: none; }
.htmx-indicator.htmx-request { display: inline; }
.htmx-indicator.htmx-request ~ span { display: none; }

/* ─── Guest Cards ─────────────────────────────────────────────────────── */

.guest-card {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    animation: cardSlideIn 0.3s ease-out;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guest-card--removing {
    animation: cardSlideOut 0.2s ease-in forwards;
}

@keyframes cardSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
        margin-bottom: 1rem;
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
        margin-bottom: 0;
        padding: 0;
        border-width: 0;
    }
}

/* Smooth container transitions */
#additionalAdultsContainer,
#additionalChildrenContainer {
    transition: all 0.3s ease;
}

.guest-card--primary {
    border-left: 4px solid var(--forest-green);
    background: linear-gradient(135deg, rgba(224, 242, 241, 0.3), var(--white));
}

.guest-card--child {
    border-left: 4px solid var(--accent-orange);
}

.guest-card__header {
    background: var(--bg-gray);
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.guest-card__badge {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--forest-green);
}

.guest-card--child .guest-card__badge {
    color: var(--accent-orange);
}

.guest-card__body {
    padding: 1rem;
}

.guest-card__body--readonly {
    padding: 1rem;
}

.guest-card__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.guest-card__row:last-child {
    margin-bottom: 0;
}

.guest-card__field {
    display: flex;
    flex-direction: column;
}

.guest-card__field label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.guest-card__field .read-only {
    background: var(--bg-gray);
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-main);
    border: 1px solid #e0e0e0;
}

/* Guest Count Controls */
.guest-count-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 0.5rem;
}

.guest-count-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.guest-count-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guest-count-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--forest-green);
    background: var(--white);
    color: var(--forest-green);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    padding: 0;
}

.guest-count-btn:hover {
    background: var(--forest-green);
    color: var(--white);
}

.guest-count-input {
    width: 3rem;
    text-align: center;
    border: 2px solid var(--seafoam);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--forest-green);
    background: var(--seafoam);
    padding: 0.3rem 0;
    -moz-appearance: textfield;
}

.guest-count-input::-webkit-outer-spin-button,
.guest-count-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.max-indicator {
    font-size: 0.75rem;
    color: var(--text-light);
    opacity: 0.6;
    margin: 0 0.25rem;
    font-weight: 400;
}

/* Flex gap utility */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-4 { gap: 1rem; }
.w-100 { width: 100%; }
.mb-4 { margin-bottom: 1rem; }

.guest-count-info {
    font-size: 0.75rem;
    color: var(--text-light);
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    font-style: italic;
}

/* ─── Error Banner (non-destructive, floating) ────────────────────────── */

.error-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    border: 1px solid #f97316;
    border-left: 4px solid #f97316;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
    animation: bannerSlideIn 0.3s ease-out;
}

@keyframes bannerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-banner__content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.error-banner__content h5 {
    margin: 0 0 0.25rem 0;
    color: #c2410c;
    font-size: 0.95rem;
}

.error-banner__content p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

.error-banner__retry {
    flex-shrink: 0;
    background: var(--forest-green);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}

.error-banner__retry:hover {
    background: #2a2b7d;
    transform: translateY(-1px);
}

.error-banner__dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
    transition: color 0.2s;
}

.error-banner__dismiss:hover {
    color: #333;
}
