/* Calendly-style date & time picker - 100% mobile first, fluid scaling */

/* Shared container tokens - fluid, scale with viewport */
:root {
    --form-radius: clamp(8px, 2.5vw, 10px);
    --form-radius-lg: clamp(10px, 3vw, 12px);
    --form-padding-sm: clamp(0.4rem, 1.5vw, 0.55rem);
    --form-padding-md: clamp(0.5rem, 2vw, 0.7rem);
    --form-padding-lg: clamp(0.65rem, 2.5vw, 0.9rem);
    --form-field-min-h: clamp(36px, 9vw, 38px);
    --form-btn-min-h: 36px;
    --form-font: 0.875rem;
    --form-font-sm: 0.8125rem;
    --form-placeholder-color: rgba(11, 22, 53, 0.45);
    --form-placeholder-font: 0.8125rem;
}

/* ========== MOBILE FIRST: Hero form - all elements fluid ========== */
/* CRITICAL: overflow:visible so date/time dropdowns are not clipped by cta-box */
.hero-form-wrap.cta-box {
    width: 100%;
    max-width: min(100%, 360px);
    padding: 0;
    overflow: visible !important;
    border-radius: var(--form-radius-lg);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    min-width: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 100;
}
.hero-form-wrap .cta-box-body,
.hero-form-wrap .cta-box-header {
    overflow: visible !important;
}

/* Form rows: 1 column base, fluid gap */
.hero-form-wrap .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(0.4rem, 1.5vw, 0.75rem);
}
.hero-form-wrap .form-row.form-row-full {
    grid-template-columns: 1fr;
}

/* Form groups - fluid margins */
.hero-form-wrap .form-group {
    margin-bottom: clamp(0.4rem, 1.5vw, 0.6rem);
    min-width: 0;
}
.hero-form-wrap .form-group:last-child {
    margin-bottom: 0;
}

/* Labels - fluid font, scale with screen */
.hero-form-wrap .form-group label,
.hero-form-wrap .cta-schedule-field label {
    display: block;
    font-size: clamp(0.7rem, 1.8vw, 0.8125rem);
    font-weight: 600;
    color: var(--navy, var(--brand-navy));
    margin-bottom: clamp(0.25rem, 0.8vw, 0.4rem);
    text-align: left;
}

/* Inputs, select, textarea - consistent size, padding, min-height, border */
.hero-form-wrap input,
.hero-form-wrap select,
.hero-form-wrap textarea {
    width: 100%;
    max-width: 100%;
    min-height: var(--form-field-min-h);
    padding: 0.48rem 0.65rem;
    font-size: var(--form-font);
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    border-radius: var(--form-radius);
    border: 1px solid rgba(11, 22, 53, 0.1);
    background: var(--cream, var(--bg-secondary));
    color: var(--navy, var(--brand-navy));
}
.hero-form-wrap input:hover,
.hero-form-wrap select:hover,
.hero-form-wrap textarea:hover {
    border-color: rgba(11, 22, 53, 0.16);
}
.hero-form-wrap input:focus,
.hero-form-wrap select:focus,
.hero-form-wrap textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.12);
    background: #fff;
}
.hero-form-wrap input::placeholder,
.hero-form-wrap textarea::placeholder {
    font-size: var(--form-placeholder-font);
    color: var(--form-placeholder-color);
    line-height: 1.4;
    opacity: 1;
}
.hero-form-wrap textarea {
    min-height: 76px;
    resize: vertical;
}
.hero-form-wrap select {
    padding-right: 2.25rem;
    cursor: pointer;
}
@media (max-width: 480px) {
    .hero-form-wrap input,
    .hero-form-wrap select,
    .hero-form-wrap textarea {
        font-size: 16px; /* prevents iOS zoom on focus */
    }
    .hero-form-wrap input::placeholder,
    .hero-form-wrap textarea::placeholder {
        font-size: 0.8125rem;
    }
}

/* Picker triggers - match input height and typography */
.hero-form-wrap .cta-picker-trigger {
    width: 100%;
    max-width: 100%;
    min-height: var(--form-field-min-h);
    padding: 0.48rem 0.65rem 0.48rem 2rem;
    font-size: var(--form-font);
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}
.hero-form-wrap .cta-picker-value.placeholder {
    font-size: var(--form-placeholder-font);
    color: var(--form-placeholder-color);
    line-height: 1.4;
}
.hero-form-wrap .cta-picker-wrap .cta-schedule-input-icon {
    left: 0.65rem;
    width: 13px;
    height: 13px;
}

/* Trust row - single line, scroll-safe on small screens */
.hero-form-wrap .cta-trust-row {
    display: flex;
    flex-wrap: wrap !important;
    gap: 0.35rem 0.5rem !important;
    align-items: center;
}
.hero-form-wrap .cta-trust-item {
    font-size: 0.625rem;
    white-space: nowrap;
    gap: 0.22rem;
    flex-shrink: 1;
}
.hero-form-wrap .cta-trust-item svg { width: 10px; height: 10px; }
/* Keep first two trust points on first row; place third on second row */
.hero-form-wrap .cta-trust-item:nth-child(1),
.hero-form-wrap .cta-trust-item:nth-child(2) {
    flex: 0 0 auto;
    white-space: nowrap;
}
.hero-form-wrap .cta-trust-item:nth-child(3) {
    flex: 0 0 auto;
    white-space: nowrap;
    margin-top: 0;
}
@media (max-width: 640px) {
    .hero-form-wrap .cta-trust-item:nth-child(3) {
        flex: 0 0 100%;
        margin-top: 0.2rem;
    }
}

/* Picker wrap: full width */
.hero-form-wrap .cta-picker-wrap {
    width: 100%;
    min-width: 0;
}

/* Step title - fluid */
.hero-form-wrap .hero-step-title {
    font-size: clamp(0.8rem, 2vw, 0.9375rem);
    font-weight: 600;
    margin-bottom: clamp(0.35rem, 1.2vw, 0.5rem);
}

/* Step dots - fluid size and gap */
.hero-form-wrap .hero-form-steps {
    gap: clamp(0.35rem, 1.2vw, 0.5rem);
}
.hero-form-wrap .hero-step-dot {
    width: clamp(8px, 2.2vw, 10px);
    height: clamp(8px, 2.2vw, 10px);
    min-width: 8px;
    min-height: 8px;
}

/* Form header (inside cta-box) - fluid */
.hero-form-wrap .cta-box-header h2 {
    font-size: clamp(1rem, 4vw, 1.25rem);
}
.hero-form-wrap .cta-box-header > p {
    font-size: clamp(0.75rem, 2vw, 0.8375rem);
}

/* ========== Progressive enhancement (tablet+) ========== */
@media (min-width: 480px) {
    .hero-form-wrap .form-row:not(.form-row-full) {
        grid-template-columns: 1fr 1fr;
        gap: clamp(0.5rem, 2vw, 0.85rem);
    }
}

/* ========== Unified container styling - smooth, flexible, consistent ========== */
.hero-form-wrap {
    max-width: min(100%, 360px);
    padding: 0;
    overflow: visible;
    border-radius: var(--form-radius-lg);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    min-width: 0;
}
.hero-form-wrap .cta-form-fields,
.hero-form-wrap form {
    min-width: 0;
}
.hero-form-wrap .cta-box-body,
.hero-form-wrap .cta-form-fields,
.hero-form-wrap .cta-form-section {
    overflow: visible;
}
.hero-form-wrap .cta-box-header {
    padding: clamp(0.7rem, 2.8vw, 0.95rem) clamp(0.8rem, 3vw, 1rem);
    border-radius: var(--form-radius-lg) var(--form-radius-lg) 0 0;
}
.hero-form-wrap .cta-box-body {
    padding: clamp(0.5rem, 2.2vw, 0.7rem) clamp(0.65rem, 2.8vw, 0.95rem);
}
.hero-form-wrap .hero-form-step,
.hero-form-wrap .hero-step-title,
.hero-form-wrap .form-row,
.hero-form-wrap .form-group {
    transition: opacity 0.2s ease;
}
.hero-form-wrap .hero-schedule-block {
    padding: clamp(0.4rem, 1.8vw, 0.55rem) clamp(0.5rem, 2.2vw, 0.65rem);
    margin-bottom: 0.5rem;
    border-radius: var(--form-radius);
    background: rgba(11, 22, 53, 0.025);
    border: 1px solid rgba(11, 22, 53, 0.04);
}
.hero-form-wrap .cta-schedule-field {
    border-radius: var(--form-radius);
}
/* Picker triggers - match input styling (border, radius, focus) */
.hero-form-wrap .cta-picker-trigger {
    border-radius: var(--form-radius);
    background: var(--cream, var(--bg-secondary)) !important;
    border: 1px solid rgba(11, 22, 53, 0.1) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}
.hero-form-wrap .cta-picker-trigger:hover {
    border-color: rgba(11, 22, 53, 0.16) !important;
    background: #fff !important;
}
.hero-form-wrap .cta-picker-trigger[aria-expanded="true"] {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.12) !important;
    background: #fff !important;
}
.hero-form-wrap .cta-picker-trigger:has(.cta-picker-value:not(.placeholder)) {
    border-color: rgba(255, 102, 0, 0.35) !important;
    background: rgba(255, 102, 0, 0.04) !important;
}
.hero-form-wrap .cta-picker-trigger:has(.cta-picker-value:not(.placeholder)):hover {
    border-color: rgba(255, 102, 0, 0.5) !important;
}
.hero-form-wrap .hero-form-nav {
    margin-top: clamp(0.7rem, 2.5vw, 0.95rem);
    padding-top: clamp(0.55rem, 2.2vw, 0.85rem);
    gap: clamp(0.35rem, 1.5vw, 0.5rem);
    border-top: 1px solid rgba(11, 22, 53, 0.06);
}
.hero-form-wrap .hero-form-steps {
    margin-bottom: clamp(0.75rem, 2.5vw, 0.95rem);
}
@media (min-width: 375px) {
    .hero-form-wrap,
    .hero-form-wrap.cta-box { max-width: min(100%, 380px); }
}
@media (min-width: 480px) {
    .hero-form-wrap,
    .hero-form-wrap.cta-box { max-width: min(100%, 400px); }
}
@media (min-width: 640px) {
    .hero-form-wrap,
    .hero-form-wrap.cta-box { max-width: min(100%, 420px); }
}

/* Mobile: safe area, prevent overflow, ensure containers work */
@media (max-width: 480px) {
    .hero-form-wrap,
    .hero-form-wrap.cta-box {
        max-width: 100%;
        width: 100%;
    }
    .hero-form-wrap .cta-box-header,
    .hero-form-wrap .cta-box-body {
        padding-left: max(0.7rem, env(safe-area-inset-left, 0.5rem));
        padding-right: max(0.7rem, env(safe-area-inset-right, 0.5rem));
    }
    /* Picker dropdowns: match trigger width, respect safe area */
    .hero-form-wrap .hero-date-dropdown,
    .hero-form-wrap .hero-time-dropdown {
        left: 0;
        right: 0;
        width: 100%;
        max-width: calc(100vw - 1rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    }
}
/* ========== Schedule consultation button - fluid, mobile first ========== */
.hero-form-wrap .hero-form-submit {
    flex: 0 1 auto;
    min-height: var(--form-btn-min-h);
    padding: clamp(0.4rem, 1.8vw, 0.55rem) clamp(0.65rem, 3vw, 1rem);
    font-size: clamp(0.8rem, 2vw, 0.9375rem);
    font-weight: 600;
    border-radius: var(--form-radius-lg);
}
.hero-form-wrap .hero-form-back,
.hero-form-wrap .hero-form-next {
    min-height: var(--form-btn-min-h);
    padding: clamp(0.4rem, 1.8vw, 0.55rem) clamp(0.5rem, 2.2vw, 0.8rem);
    font-size: clamp(0.8rem, 2vw, 0.9375rem);
    border-radius: var(--form-radius-lg);
}

/* Step dots - fluid size */
.hero-form-wrap .hero-step-dot {
    width: clamp(8px, 2.5vw, 10px);
    height: clamp(8px, 2.5vw, 10px);
    min-width: 8px;
    min-height: 8px;
}
.hero-form-wrap .hero-form-steps {
    gap: clamp(0.25rem, 1vw, 0.4rem);
}

/* Header h2 & p - fluid typography */
.hero-form-wrap .cta-box-header h2 {
    font-size: clamp(1rem, 3.5vw, 1.25rem);
    line-height: 1.3;
}
.hero-form-wrap .cta-box-header > p {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

/* ========== Picker dropdowns - above all content, never clipped ========== */
/* CRITICAL: hero section has overflow:hidden which clips dropdowns - allow overflow when form is present */
/* CRITICAL: hero must stack above trust-strip (which follows in DOM) so dropdowns are visible */
.hero:has(.hero-form-wrap) {
    overflow: visible !important;
    position: relative;
    z-index: 10;
}
.hero:has(.hero-form-wrap) .hero-grid {
    overflow: visible !important;
}
/* Hero form: allow dropdowns to overflow (override cta-box overflow:hidden) */
.hero-form-wrap.cta-box,
.hero-form-wrap .cta-box-body,
.hero-form-wrap .cta-form-fields,
.hero-form-wrap .hero-schedule-block,
.hero-form-wrap .cta-schedule-field {
    overflow: visible !important;
}
.cta-picker-wrap {
    position: relative;
    overflow: visible;
}
.hero-date-dropdown,
.hero-time-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    max-width: min(320px, calc(100vw - 1rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    z-index: 9998 !important; /* Above trust strip, hero content - never clipped */
    background: #fff;
    background: linear-gradient(180deg, #fff 0%, var(--bg-secondary) 100%);
    border-radius: var(--radius-card);
    overflow: visible !important;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
}
/* Hero form: attach dropdowns below triggers; date dropdown has min width for readable calendar */
.hero-form-wrap .cta-picker-wrap .hero-date-dropdown,
.hero-form-wrap .cta-picker-wrap .hero-time-dropdown {
    top: 100%;
    margin-top: 6px;
    left: 0;
    right: auto;
    margin-left: 0;
    max-width: none;
}
.hero-form-wrap .cta-picker-wrap .hero-date-dropdown {
    width: 100%;
    min-width: 280px;
    max-width: calc(100vw - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
}
.hero-form-wrap .cta-picker-wrap .hero-time-dropdown {
    width: 100%;
    min-width: 0;
}
@media (min-width: 480px) {
    .hero-form-wrap .cta-picker-wrap .hero-date-dropdown {
        width: max(100%, 280px);
        max-width: 320px;
    }
}
/* Time picker: ensure scrollbar has room and is never clipped */
.hero-time-dropdown .cta-time-inner {
    padding-right: 0.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
/* Override home.html cta-picker-dropdown overflow:hidden on mobile - hero dropdowns must stay visible */
@media (max-width: 768px) {
    .hero-date-dropdown,
    .hero-time-dropdown {
        overflow: visible !important;
    }
}
/* Inner cards: clip content but not the dropdown itself */
.hero-date-dropdown .cta-calendar-card,
.hero-time-dropdown .cta-time-card {
    overflow: hidden;
}
/* On wider viewports, dropdown can grow */
@media (min-width: 380px) {
    .hero-date-dropdown,
    .hero-time-dropdown {
        max-width: 320px;
    }
}
/* Schedule fields: 1 column on mobile, 2 on tablet+ */
.hero-schedule-block .cta-schedule-fields {
    grid-template-columns: 1fr;
    gap: 0.65rem;
}
@media (min-width: 480px) {
    .hero-schedule-block .cta-schedule-fields {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========== Calendar card – mobile-first, readable width ========== */
.cta-calendar-card {
    background: #fff;
    padding: 0.75rem 0.65rem;
    border-radius: var(--radius-card);
    overflow: hidden;
    min-width: 0;
    box-sizing: border-box;
}
.cta-calendar-card .cta-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 0.5rem;
    padding: 0 0.1rem;
    background: none;
    border: none;
    gap: 0.5rem;
}
.cta-calendar-card .cta-calendar-nav {
    min-width: 28px;
    min-height: 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: var(--radius-btn);
    background: rgba(11, 22, 53, 0.06);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}
.cta-calendar-card .cta-calendar-nav:hover {
    background: rgba(11, 22, 53, 0.1);
    color: var(--brand-navy);
}
.cta-calendar-card .cta-calendar-nav:active {
    transform: scale(0.96);
}
.cta-calendar-card .cta-calendar-nav svg {
    width: 10px;
    height: 10px;
}
.cta-calendar-card .cta-calendar-month-year {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--brand-navy);
    text-align: center;
    flex: 1;
    letter-spacing: 0.01em;
}
.cta-calendar-card .cta-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    margin-bottom: 0.35rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: rgba(11, 22, 53, 0.5);
    text-align: center;
}
.cta-calendar-card .cta-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cta-calendar-card .cta-calendar-day {
    aspect-ratio: 1;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    border-radius: var(--radius-btn);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.cta-calendar-card .cta-calendar-day:hover:not(.other-month):not(.disabled) {
    background: rgba(11, 22, 53, 0.08);
    color: var(--brand-navy);
}
.cta-calendar-card .cta-calendar-day:active:not(.other-month):not(.disabled) {
    transform: scale(0.95);
}
.cta-calendar-card .cta-calendar-day.selected {
    background: var(--brand-navy);
    color: #fff;
}
.cta-calendar-card .cta-calendar-day.today:not(.selected) {
    background: rgba(255, 102, 0, 0.12);
    color: var(--brand-navy);
}
.cta-calendar-card .cta-calendar-day.other-month {
    color: #d1d5db;
}
.cta-calendar-card .cta-calendar-day.disabled {
    color: #e5e7eb;
    cursor: not-allowed;
}
.cta-calendar-card .cta-calendar-today,
.cta-calendar-card [data-today] {
    display: block;
    width: 100%;
    margin: 0.5rem 0 0;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-orange);
    background: rgba(255, 102, 0, 0.08);
    border: 1px solid rgba(255, 102, 0, 0.2);
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: background 0.2s ease;
}
.cta-calendar-card .cta-calendar-today:hover,
.cta-calendar-card [data-today]:hover {
    background: rgba(255, 102, 0, 0.12);
}
.cta-calendar-card .cta-calendar-today:active,
.cta-calendar-card [data-today]:active {
    transform: scale(0.98);
}
/* Mobile: larger touch targets for days */
@media (max-width: 480px) {
    .cta-calendar-card {
        padding: 0.85rem 0.75rem;
    }
    .cta-calendar-card .cta-calendar-day {
        min-height: 36px;
        font-size: 0.875rem;
    }
    .cta-calendar-card .cta-calendar-days {
        gap: 5px;
    }
    .cta-calendar-card .cta-calendar-month-year {
        font-size: 0.875rem;
    }
    .cta-calendar-card .cta-calendar-nav {
        min-width: 32px;
        min-height: 32px;
        width: 32px;
        height: 32px;
    }
    .cta-calendar-card .cta-calendar-nav svg {
        width: 12px;
        height: 12px;
    }
}
@media (min-width: 481px) {
    .cta-calendar-card .cta-calendar-day {
        min-height: 34px;
    }
}

/* ========== Time card - rounded (match calendar), 3D touch ========== */
.cta-time-card {
    background: #fff;
    padding: 0.45rem 0.5rem;
    border-radius: var(--radius-btn);
    overflow: hidden;
}
.cta-time-header {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-bottom: 0.3rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--bg-secondary);
}
.cta-time-card .cta-time-inner {
    max-height: 156px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.cta-time-card .cta-time-grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cta-time-card .cta-time-slot {
    min-height: clamp(32px, 8vw, 36px);
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    border-radius: var(--radius-btn);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #f2f3f5 100%);
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}
.cta-time-card .cta-time-slot:hover {
    background: linear-gradient(180deg, #eef0f2 0%, #e8eaed 100%);
    color: var(--brand-navy-light);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.cta-time-card .cta-time-slot:active {
    transform: scale(0.97);
    box-shadow: 0 0 0 transparent;
}
.cta-time-card .cta-time-slot.selected {
    background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy) 100%);
    color: #fff;
    border-color: var(--brand-navy);
    box-shadow: 0 2px 6px rgba(11, 22, 53, 0.35);
}
.cta-time-card .cta-time-slot.selected::after {
    content: ' ✓';
    font-weight: 700;
}

