/* ==========================================================================
   FAWOHODIE RETREAT – MULTI-STEP TABBED FORM SYSTEM
   Compact, sleek, high-density 3-column form experience
   ========================================================================== */

:root {
    --step-primary: #123f74;
    --step-primary-hover: #0d2f57;
    --step-accent: #c0392b;
    --step-accent-hover: #a93226;
    --step-success: #10b981;
    --step-border: #e2eaf5;
    --step-bg-muted: #f8fafc;
    --step-text-main: #1e293b;
    --step-text-muted: #64748b;
    --step-radius: 10px;
}

/* ==========================================================================
   1. STEPPER NAVIGATION HEADER (DESKTOP)
   ========================================================================== */

.form-stepper-container {
    margin-bottom: 20px;
    user-select: none;
}

.form-stepper-desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: var(--step-radius);
    padding: 6px 10px;
    box-shadow: 0 2px 8px rgba(18, 63, 116, 0.04);
    overflow-x: auto;
    position: relative;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s ease-in-out;
    position: relative;
    white-space: nowrap;
    color: var(--step-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    flex: 1;
    justify-content: center;
}

.step-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-top: 1.5px solid #cbd5e1;
    border-right: 1.5px solid #cbd5e1;
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
}

.step-item:hover:not(.disabled) {
    background-color: var(--step-bg-muted);
    color: var(--step-primary);
}

.step-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.step-title {
    letter-spacing: 0.01em;
}

/* Active Step */
.step-item.active {
    background: #edf4fc;
    color: var(--step-primary);
    font-weight: 700;
}

.step-item.active .step-badge {
    background: var(--step-primary);
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(18, 63, 116, 0.12);
}

/* Completed Step */
.step-item.completed {
    color: var(--step-primary);
}

.step-item.completed .step-badge {
    background: var(--step-success);
    color: #ffffff;
}

/* Disabled Step */
.step-item.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==========================================================================
   2. MOBILE PROGRESS STEPPER
   ========================================================================== */

.form-stepper-mobile {
    display: none;
    background: #ffffff;
    border: 1px solid var(--step-border);
    border-radius: var(--step-radius);
    padding: 12px 14px;
    box-shadow: 0 2px 10px rgba(18, 63, 116, 0.04);
    margin-bottom: 16px;
}

.mobile-step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mobile-step-indicator {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--step-primary);
}

.mobile-step-percentage {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--step-accent);
}

.mobile-progress-track {
    width: 100%;
    height: 6px;
    background: #e2eaf5;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.mobile-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--step-primary) 0%, var(--step-accent) 100%);
    border-radius: 8px;
    transition: width 0.35s ease;
}

.mobile-dots-indicator {
    display: flex;
    justify-content: center;
    gap: 7px;
}

.mobile-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    transition: all 0.2s;
}

.mobile-dot.active {
    background: var(--step-primary);
    color: #fff;
    transform: scale(1.15);
}

.mobile-dot.completed {
    background: var(--step-success);
    color: #fff;
}

/* ==========================================================================
   3. TAB PANES & TRANSITIONS
   ========================================================================== */

.form-tab-pane {
    display: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.form-tab-pane.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Step Header inside pane */
.tab-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #edf2f7;
}

.tab-pane-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--step-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tab-pane-title-badge {
    background: var(--step-primary);
    color: #fff;
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 12px;
    font-weight: 700;
}

.tab-pane-subtitle {
    color: var(--step-text-muted);
    font-size: 0.78rem;
    margin: 2px 0 0 0;
}

/* ==========================================================================
   4. NAVIGATION ACTION FOOTER
   ========================================================================== */

.tab-action-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1.5px solid #edf2f7;
    gap: 12px;
    flex-wrap: wrap;
}

.tab-action-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-action-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Back Button */
.btn-tab-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.16s ease;
    text-decoration: none !important;
}

.btn-tab-back:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
}

/* Next / Continue Button */
.btn-tab-next {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--step-accent);
    color: #ffffff !important;
    border: none;
    padding: 9px 22px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.16s ease;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.2);
}

.btn-tab-next:hover {
    background: var(--step-accent-hover);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.28);
    transform: translateY(-1px);
}

/* Auto-save Status Badge */
.autosave-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #64748b;
    padding: 3px 8px;
    border-radius: 12px;
    background: #f1f5f9;
}

.autosave-badge.saved {
    color: #059669;
    background: #ecfdf5;
}

.autosave-badge.saving {
    color: #d97706;
    background: #fffbeb;
}

/* Draft Restored Alert Banner */
#draft-restored-banner,
.draft-restored-banner {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1e40af !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    margin-bottom: 14px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px 12px !important;
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    animation: fadeInDraft 0.25s ease;
}

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

.draft-banner-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    word-break: break-word !important;
    margin: 0 !important;
    padding: 0 !important;
}

#btn-clear-draft,
.clear-draft-link {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fca5a5 !important;
    border-radius: 6px !important;
    padding: 5px 12px !important;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    white-space: normal !important;
    text-align: center !important;
    flex: 0 0 auto !important;
    transition: all 0.16s ease !important;
    text-decoration: none !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.3 !important;
}

#btn-clear-draft:hover,
.clear-draft-link:hover {
    background: #fecaca !important;
    color: #991b1b !important;
}

/* Validation Highlights */
.sc_form_item input.field-invalid,
.sc_form_item select.field-invalid,
.custom-datepicker-trigger.field-invalid,
.custom-timepicker-trigger.field-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
}

.field-error-msg {
    color: #dc2626;
    font-size: 0.70rem;
    font-weight: 600;
    margin-top: 2px;
    display: block;
}

/* ==========================================================================
   5. WIDER CARD, COMPACT FIELDS & 3-COLUMN LAYOUT SYSTEM
   ========================================================================== */

#register_form,
#update_reg_form {
    max-width: 1240px !important;
    width: 100% !important;
    padding: 28px 36px 36px !important;
    box-sizing: border-box !important;
    margin: 8px auto 36px !important;
    border-radius: 12px !important;
}

/* Strip nested card borders and double padding inside tab panes */
#register_form .columns_wrap.sc_columns,
#update_reg_form .columns_wrap.sc_columns {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    box-sizing: border-box !important;
    margin-left: -10px !important;
    margin-right: -10px !important;
    width: calc(100% + 20px) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

/* 3 columns on desktop */
#register_form .columns_wrap.sc_columns > .column-1_3,
#update_reg_form .columns_wrap.sc_columns > .column-1_3 {
    flex: 0 0 33.333333% !important;
    max-width: 33.333333% !important;
    width: 33.333333% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    float: none !important;
    box-sizing: border-box !important;
}

#register_form .columns_wrap.sc_columns > .column-2_3,
#update_reg_form .columns_wrap.sc_columns > .column-2_3 {
    flex: 0 0 66.666667% !important;
    max-width: 66.666667% !important;
    width: 66.666667% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    float: none !important;
    box-sizing: border-box !important;
}

#register_form .columns_wrap.sc_columns > .column-3_3,
#update_reg_form .columns_wrap.sc_columns > .column-3_3 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    float: none !important;
    box-sizing: border-box !important;
}

#register_form .columns_wrap.sc_columns > .column-1_2,
#update_reg_form .columns_wrap.sc_columns > .column-1_2 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    width: 50% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    float: none !important;
    box-sizing: border-box !important;
}

#register_form .columns_wrap.sc_columns > h4,
#update_reg_form .columns_wrap.sc_columns > h4,
#register_form .columns_wrap.sc_columns > .columns_wrap,
#update_reg_form .columns_wrap.sc_columns > .columns_wrap,
#register_form .columns_wrap.sc_columns > hr,
#update_reg_form .columns_wrap.sc_columns > hr,
#register_form .columns_wrap.sc_columns > div:not([class*="column-"]),
#update_reg_form .columns_wrap.sc_columns > div:not([class*="column-"]) {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   6. COMPACT SLEEK FIELD BOXES & LABELS
   ========================================================================== */

#register_form .sc_form_item,
#update_reg_form .sc_form_item {
    margin-bottom: 12px !important;
}

#register_form .sc_form_item label,
#register_form .sc_form_item > label,
#update_reg_form .sc_form_item label,
#update_reg_form .sc_form_item > label {
    display: block !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: #123f74 !important;
    margin-bottom: 3px !important;
}

/* Compact input and select sizing */
#register_form .sc_form_item input[type="text"],
#register_form .sc_form_item input[type="email"],
#register_form .sc_form_item input[type="number"],
#register_form .sc_form_item input[type="date"],
#register_form .sc_form_item input[type="time"],
#register_form .sc_form_item input[type="password"],
#register_form .sc_form_item input[type="tel"],
#register_form .sc_form_item input[type="search"],
#register_form .sc_form_select_container select,
#register_form .sc_form_item select,
#register_form .custom-datepicker-trigger,
#register_form .custom-timepicker-trigger,
#update_reg_form .sc_form_item input[type="text"],
#update_reg_form .sc_form_item input[type="email"],
#update_reg_form .sc_form_item input[type="number"],
#update_reg_form .sc_form_item input[type="date"],
#update_reg_form .sc_form_item input[type="time"],
#update_reg_form .sc_form_item input[type="password"],
#update_reg_form .sc_form_item input[type="tel"],
#update_reg_form .sc_form_item input[type="search"],
#update_reg_form .sc_form_select_container select,
#update_reg_form .sc_form_item select,
#update_reg_form .custom-datepicker-trigger,
#update_reg_form .custom-timepicker-trigger {
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    line-height: normal !important;
    color: #1e293b !important;
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 6px !important;
    outline: none !important;
    transition: border-color 0.16s, box-shadow 0.16s !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

#register_form .custom-datepicker-trigger .date-display,
#register_form .custom-timepicker-trigger .time-display,
#update_reg_form .custom-datepicker-trigger .date-display,
#update_reg_form .custom-timepicker-trigger .time-display {
    font-size: 0.85rem !important;
    line-height: normal !important;
}

#register_form .custom-datepicker-trigger::after,
#register_form .custom-timepicker-trigger::after,
#update_reg_form .custom-datepicker-trigger::after,
#update_reg_form .custom-timepicker-trigger::after {
    font-size: 0.88rem !important;
    margin-left: 6px !important;
}

#register_form .sc_form_item textarea,
#update_reg_form .sc_form_item textarea {
    width: 100% !important;
    min-height: 64px !important;
    max-height: 90px !important;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    color: #1e293b !important;
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 6px !important;
    outline: none !important;
    box-sizing: border-box !important;
}

#register_form .sc_form_item input:focus,
#register_form .sc_form_select_container select:focus,
#register_form .sc_form_item select:focus,
#update_reg_form .sc_form_item input:focus,
#update_reg_form .sc_form_select_container select:focus,
#update_reg_form .sc_form_item select:focus {
    border-color: #123f74 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(18, 63, 116, 0.10) !important;
}

#register_form .sc_form_item small,
#update_reg_form .sc_form_item small {
    display: block !important;
    font-size: 0.70rem !important;
    line-height: 1.25 !important;
    color: #64748b !important;
    margin-top: 2px !important;
}

/* ==========================================================================
   7. SEAMLESS CONDITIONAL / HIDDEN INPUT PANELS
   ========================================================================== */

#num_children_container,
#medical_condition_field {
    margin: 0 !important;
}

#flightdiv,
#zelle {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
    padding: 12px 14px 4px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    width: 100% !important;
}

.child-details {
    margin-bottom: 10px !important;
    padding: 10px 14px 4px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
}

.child-details h4 {
    font-size: 0.84rem !important;
    margin: 0 0 6px 0 !important;
    font-weight: 700 !important;
    color: #123f74 !important;
}

.child-details hr {
    display: none !important;
}

/* Notice & fee alert boxes */
#online_payment_notice > div,
#arrival_payment_notice > div,
#exempt_notice > div,
#pre_retreat_total,
#pre_fawohodie_fee_display > div {
    padding: 10px 14px !important;
    margin: 8px 0 !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
}

#online_payment_notice h4,
#arrival_payment_notice h4,
#exempt_notice h4 {
    font-size: 0.90rem !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
}

#online_payment_notice p,
#arrival_payment_notice p,
#exempt_notice p {
    font-size: 0.82rem !important;
    margin-bottom: 4px !important;
}

/* Pre-retreat day pills */
#pre_retreat_days_container label {
    padding: 8px 10px !important;
    min-height: 44px !important;
    font-size: 0.84rem !important;
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 6px !important;
}

/* Submit buttons */
button#register_btn,
button#update_registration_btn {
    padding: 11px 24px !important;
    font-size: 0.88rem !important;
    max-width: 280px !important;
    border-radius: 6px !important;
}

/* ==========================================================================
   8. RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 1100px) and (min-width: 768px) {
    #register_form,
    #update_reg_form {
        padding: 22px 24px 30px !important;
    }
    #register_form .columns_wrap.sc_columns > .column-1_3,
    #update_reg_form .columns_wrap.sc_columns > .column-1_3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        width: 50% !important;
    }
}

@media (max-width: 900px) {
    .form-stepper-desktop {
        display: none;
    }
    
    .form-stepper-mobile {
        display: block;
    }

    /* Mobile banner stacks neatly */
    #draft-restored-banner,
    .draft-restored-banner {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: left !important;
        padding: 10px 12px !important;
        gap: 8px !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .draft-banner-text {
        flex: 0 0 auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
    }

    #btn-clear-draft,
    .clear-draft-link {
        flex: 0 0 auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 7px 12px !important;
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        margin-top: 2px !important;
    }

    /* Mobile action footer: clean vertical stack */
    .tab-action-footer {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .tab-action-right {
        width: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        order: 1 !important;
    }

    .tab-action-left {
        width: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        order: 2 !important;
    }

    .btn-tab-next,
    button#register_btn,
    button#update_registration_btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        justify-content: center !important;
        white-space: normal !important;
        text-align: center !important;
        line-height: 1.3 !important;
        padding: 12px 14px !important;
        font-size: 0.88rem !important;
        display: flex !important;
        align-items: center !important;
    }

    .btn-tab-back {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        justify-content: center !important;
        white-space: normal !important;
        text-align: center !important;
        line-height: 1.3 !important;
        padding: 10px 14px !important;
        font-size: 0.84rem !important;
        display: flex !important;
        align-items: center !important;
    }

    .autosave-status {
        display: block !important;
        text-align: center !important;
        font-size: 0.72rem !important;
        color: #64748b !important;
        margin-top: 2px !important;
    }
}

@media (max-width: 767px) {
    #register_form,
    #update_reg_form {
        padding: 16px 12px 24px !important;
    }

    #register_form .columns_wrap.sc_columns > .column-1_3,
    #update_reg_form .columns_wrap.sc_columns > .column-1_3,
    #register_form .columns_wrap.sc_columns > .column-2_3,
    #update_reg_form .columns_wrap.sc_columns > .column-2_3,
    #register_form .columns_wrap.sc_columns > .column-1_2,
    #update_reg_form .columns_wrap.sc_columns > .column-1_2 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}
