/* =====================================================
   CHARTER STEPS v1.0 — Multi-step Form UI
   Add this stylesheet AFTER charter_v.css
   Link: <link href="/redesign_v/css_v/charter_steps.css?v=1.0" rel="stylesheet">
===================================================== */

/* ============================================================
   STEP INDICATOR BAR
============================================================ */
.form-stepper {
    display: flex;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1.5px solid rgba(255, 107, 53, 0.12);
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.stepper-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 53, 0.22);
    background: var(--sand);
    color: var(--medium-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 16px;
    transition: all 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.stepper-item.is-active .stepper-circle {
    background: var(--gradient-primary);
    border-color: var(--primary-orange);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.38);
    transform: scale(1.1);
}

.stepper-item.is-done .stepper-circle {
    background: var(--sage-green);
    border-color: var(--sage-green);
    color: var(--white);
    transform: scale(1.0);
}

.stepper-label {
    font-size: 10.5px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: rgba(138, 125, 112, 0.7);
    margin-top: 9px;
    text-align: center;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: color 0.3s;
    max-width: 80px;
    line-height: 1.3;
}

.stepper-item.is-active .stepper-label { color: var(--primary-orange); }
.stepper-item.is-done .stepper-label   { color: var(--sage-green); }

.stepper-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 107, 53, 0.14);
    margin-top: 23px;  /* vertically align with circle center */
    transition: background 0.45s ease;
    max-width: 100%;
    min-width: 20px;
}

.stepper-line.is-done {
    background: var(--sage-green);
}

/* ============================================================
   FORM STEP PANELS
============================================================ */
.form-step {
    display: none;
}

.form-step.is-active {
    display: block;
    animation: stepSlideForward 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-step.is-active.step-from-back {
    animation: stepSlideBack 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes stepSlideForward {
    from { opacity: 0; transform: translateX(22px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes stepSlideBack {
    from { opacity: 0; transform: translateX(-22px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   STEP NAVIGATION BUTTONS
============================================================ */
.form-step-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1.5px solid rgba(255, 107, 53, 0.1);
}

.form-step-nav--end {
    justify-content: flex-end;
}

.btn-step-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 20px;
    background: transparent;
    border: 2px solid rgba(255, 107, 53, 0.2);
    border-radius: 10px;
    color: var(--medium-gray);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.1px;
}

.btn-step-back:hover {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    background: rgba(255, 107, 53, 0.05);
}

.btn-step-next {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    color: var(--white);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-orange);
    letter-spacing: 0.1px;
}

.btn-step-next:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(255, 107, 53, 0.44);
}

.step-counter-label {
    font-size: 12px;
    color: rgba(138, 125, 112, 0.75);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-align: center;
}

/* ============================================================
   INLINE FIELD VALIDATION FEEDBACK
============================================================ */
.field-error {
    display: none;
    font-size: 12px;
    color: var(--clay-red);
    font-weight: 500;
    margin-top: 5px;
    font-family: 'DM Sans', sans-serif;
}

.form-group.has-error .field-error {
    display: block;
}

.form-group.has-error > input,
.form-group.has-error > select,
.form-group.has-error > textarea {
    border-color: var(--clay-red) !important;
    box-shadow: 0 0 0 3px rgba(201, 74, 46, 0.1) !important;
    background: rgba(201, 74, 46, 0.04) !important;
}

/* Shake on validation error */
@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.form-group.shake {
    animation: fieldShake 0.42s ease;
}

/* ============================================================
   STEP SUMMARY CHIPS (shown at top of steps 2 & 3)
   Small recap of what was filled in previous steps
============================================================ */
.step-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    padding: 14px 16px;
    background: rgba(255, 107, 53, 0.06);
    border: 1.5px solid rgba(255, 107, 53, 0.14);
    border-radius: 10px;
}

.step-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--warm-cream);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 20px;
    font-size: 12.5px;
    color: var(--dark-gray);
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.step-summary-chip i {
    color: var(--primary-orange);
    font-size: 11px;
    flex-shrink: 0;
}

.step-summary-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   OPTIONAL SECTION COLLAPSE TOGGLE
============================================================ */
.optional-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: transparent;
    border: 1.5px dashed rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    color: var(--primary-orange);
    font-size: 13.5px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    margin-bottom: 16px;
    width: 100%;
    justify-content: center;
}

.optional-toggle:hover {
    background: rgba(255, 107, 53, 0.06);
    border-color: var(--primary-orange);
}

.optional-toggle i {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.optional-toggle.is-open i.chevron {
    transform: rotate(180deg);
}

.optional-section {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    max-height: 0;
    opacity: 0;
}

.optional-section.is-open {
    max-height: 800px;
    opacity: 1;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
    .stepper-circle { width: 38px; height: 38px; font-size: 14px; }
    .stepper-label  { font-size: 9.5px; max-width: 60px; }
    .stepper-line   { margin-top: 19px; }

    .btn-step-next  { padding: 13px 22px; font-size: 14px; }
    .btn-step-back  { padding: 12px 16px; font-size: 13px; }

    .form-step-nav  { gap: 8px; }

    .step-summary   { gap: 6px; padding: 10px 12px; }
    .step-summary-chip { font-size: 11.5px; }
}

@media (max-width: 480px) {
    .form-stepper   { margin-bottom: 24px; padding-bottom: 20px; }
    .stepper-circle { width: 34px; height: 34px; font-size: 13px; }
    .stepper-label  { display: none; } /* hide labels on very small screens */
    .stepper-line   { margin-top: 17px; }

    .btn-step-next  { padding: 12px 18px; font-size: 14px; }
    .btn-step-back  { padding: 11px 14px; font-size: 13px; }
}