/* Camp Registration Frontend - Modern Stepper Common Styles */

body.camp-registration-page {
    background: #f3f4f6;
}

.crf-stepper {
    max-width: 960px;
    margin: 24px auto 48px;
    padding: 0 12px;
}

.crf-stepper__card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.crf-stepper__header {
    padding: 14px 18px 10px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.crf-stepper__title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.crf-stepper__title p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #6b7280;
}

.crf-stepper__form {
    padding: 18px 18px 22px;
}

/* Step navigation */
.crf-stepper__nav {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 18px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.crf-stepper__nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    cursor: default;
}

.crf-stepper__nav-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.crf-stepper__nav-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.crf-stepper__nav-item.active .crf-stepper__nav-circle {
    background: #4f46e5;
    color: #ffffff;
}

.crf-stepper__nav-item.active .crf-stepper__nav-label {
    color: #111827;
}

/* Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.crf-stepper__step-title {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}

.crf-stepper__step-subtitle {
    margin: 0 0 14px;
    font-size: 12px;
    color: #6b7280;
}

/* Cards / containers */
.crf-card,
.common-fields,
.child-fields,
.allocation-group {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 18px 16px;
}

.child-fields {
    background: #ffffff;
}

/* Grid utilities */
.form-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 1024px) {
    .form-grid.three-columns {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .form-grid.three-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 639px) {
    .form-grid.three-columns {
        grid-template-columns: 1fr;
    }
}

/* Participants grid: 2 columns on large (flex-based), 1 on smaller screens */
.crf-stepper .crf-grid-participants {
    display: flex !important;
    flex-wrap: wrap;
    gap: 16px;
}

.crf-stepper .crf-grid-participants > div {
    flex: 1 1 calc(50% - 8px);
    min-width: 260px;
}

.crf-stepper .crf-grid-participants .checkbox-grid {
    flex: 1 1 100%;
}

@media (max-width: 767px) {
    .crf-stepper .crf-grid-participants > div {
        flex: 1 1 100%;
    }
}

/* Inputs */
.crf-stepper input[type=\"text\"],
.crf-stepper input[type=\"email\"],
.crf-stepper input[type=\"tel\"],
.crf-stepper input[type=\"date\"],
.crf-stepper input[type=\"number\"],
.crf-stepper textarea,
.crf-stepper select {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.crf-stepper label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.crf-stepper input:focus,
.crf-stepper textarea:focus,
.crf-stepper select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.4);
    background: #ffffff;
}

.crf-stepper textarea {
    min-height: 80px;
    resize: vertical;
}

/* Radio group */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.radio-group label {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.radio-group input[type=\"radio\"] {
    width: auto;
}

/* Buttons */
.crf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.crf-button--primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
}

.crf-button--primary:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.35);
}

.crf-button--outline {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.crf-button--outline:hover {
    border-color: #4f46e5;
    color: #111827;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.crf-button--ghost {
    background: transparent;
    color: #6b7280;
}

.crf-button--ghost:hover {
    background: #f3f4f6;
    color: #111827;
}

.crf-stepper__actions {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.crf-stepper__actions .crf-button {
    min-width: 120px;
}

/* Child participant panels */
.child-fields {
    margin-bottom: 12px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #ffffff, #f9fafb);
}

.child-header {
    cursor: pointer;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.child-title {
    font-weight: 600;
    color: #111827;
}

.toggle-arrow {
    font-size: 16px;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.child-fields.active .toggle-arrow {
    transform: rotate(180deg);
}

.child-content {
    padding-top: 14px;
}

.delete-participant {
    color: #dc2626;
    cursor: pointer;
    font-size: 18px;
}

.delete-participant:hover {
    color: #b91c1c;
}

/* Checkbox grid (medical conditions) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.checkbox-grid p {
    grid-column: 1 / -1;
    font-weight: 600;
    margin-bottom: 4px;
}

.checkbox-grid label {
    font-weight: 500;
    font-size: 12px;
    color: #374151;
}

@media (max-width: 900px) {
    .checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* Week allocation grid */
.slot-grid {
    display: grid;
    gap: 14px;
}

@media (min-width: 768px) {
    .slot-grid.three-columns {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .slot-grid.three-columns {
        grid-template-columns: 1fr;
    }
}

/* Toast */
.crf-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: #10b981;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(5, 150, 105, 0.35);
    z-index: 9999;
    display: none;
}

/* Page loader */
#pageLoader {
    position: fixed;
    inset: 0;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

#loaderProgress {
    font-size: 26px;
    font-weight: 700;
    color: #4f46e5;
}

/* Progress percent in buttons */
.progress-container {
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #e0e7ff;
}

/* Mobile / small screens */
@media (max-width: 768px) {
    .crf-stepper {
        margin-top: 12px;
        margin-bottom: 32px;
    }

    .crf-stepper__header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 14px 8px;
    }

    .crf-stepper__nav {
        flex-direction: column;
        align-items: stretch;
        padding: 4px 14px 10px;
    }

    .crf-stepper__nav-item {
        justify-content: flex-start;
    }

    .crf-stepper__nav-circle {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .crf-stepper__nav-label {
        font-size: 12px;
    }

    /* Keep actions on a single row even on mobile */
    .crf-stepper__actions {
        flex-direction: row;
        align-items: center;
    }

    .crf-stepper__actions .crf-button {
        width: auto;
        min-width: 0;
        flex: 1 1 0;
        justify-content: center;
    }
}

/* Extra-small screens (e.g. iPhone SE) */
@media (max-width: 375px) {
    .crf-stepper {
        padding: 0 8px;
    }

    .crf-stepper__title h2 {
        font-size: 18px;
    }

    .crf-stepper__step-title {
        font-size: 16px;
    }

    .crf-stepper__step-subtitle {
        font-size: 12px;
    }

    .crf-stepper label {
        font-size: 14px;
    }

    .crf-stepper input[type="text"],
    .crf-stepper input[type="email"],
    .crf-stepper input[type="tel"],
    .crf-stepper input[type="date"],
    .crf-stepper input[type="number"],
    .crf-stepper textarea,
    .crf-stepper select {
        font-size: 15px;
        padding: 10px 12px;
    }

    .crf-button {
        font-size: 15px;
        padding: 12px 20px;
    }
}
