/* register.css */

/* --- General Form Styles --- */
.registration-form {
    /* Add general form container styles if needed */
    font-family: sans-serif;
}

/* --- Step Progress Indicator --- */
.step-progress {
    display: flex;
    /* Changed from space-around to space-evenly */
    justify-content: space-evenly;
    align-items: flex-start;
    margin-bottom: 30px;
    position: relative;
    width: 100%;
}

.step-progress:before {
    content: '';
    position: absolute;
    top: 15px; /* Adjust vertical position of the line */
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e0e0e0;
    z-index: 1; /* Behind the circles */
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2; /* Above the line */
    /* Removed width: calc() - let flexbox manage width based on content and max-width */
    max-width: 65px; /* Slightly increased max-width for potentially longer labels */
    min-width: 40px; /* Ensure a minimum width */
    padding: 0 3px; /* Small horizontal padding */
    box-sizing: border-box;
    text-align: center; /* Ensure text inside centers */
    flex-shrink: 0; /* Prevent items from shrinking too much */
    flex-grow: 0; /* Prevent items from growing excessively */
}

.step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent circle from shrinking */
}

.step-label {
    width: 100%;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    font-size: 14px;
    line-height: 1.3;
    margin-top: 5px; /* Space between circle and label */
}

/* Step Status Styles */
.step-item.active .step-circle {
    background-color: #46b450; /* Active color */
    border-color: #46b450;
    color: white;
}

.step-item.active .step-label {
    color: #46b450;
    font-weight: bold;
}

.step-item.completed .step-circle {
    background-color: #46b450; /* Completed color */
    border-color: #46b450;
    color: white;
}

.step-item.completed .step-label {
    color: #757575; /* Completed label color */
}


/* --- Step 1: Terms --- */
.terms-container {
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    background-color: #f9f9f9;
}

.terms-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    margin: 15px 0;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.terms-agreement {
    margin-top: 15px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.terms-agreement label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    cursor: pointer;
}

.terms-agreement input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.terms-checkbox-container {
    padding: 10px;
    margin-bottom: 15px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.terms-checkboxes {
    margin: 15px 0;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.term-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.term-item:last-child {
    border-bottom: none;
}

.term-item label {
    display: flex;
    align-items: flex-start; /* Align checkbox with start of text */
    cursor: pointer;
}

.term-checkbox {
    flex: 0 0 20px; /* Fixed width for checkbox */
    width: 20px;
    height: 20px;
    margin-right: 10px;
    margin-top: 3px; /* Align checkbox slightly lower */
}

.term-content {
    flex: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
}

.term-title {
    font-weight: bold;
    margin-bottom: 5px;
    min-width: 180px; /* Ensure title has enough space */
}

.term-description {
    color: #333;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}


/* --- Step 2: Participants Information --- */

/* Representative Contact Section */
.representative-contact {
    display: flex;
    flex-wrap: wrap; /* Allow sections to wrap */
    gap: 20px; /* Space between email and phone sections */
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.contact-section {
    flex: 1 1 100%; /* Default to full width */
    min-width: 250px; /* Minimum width before wrapping */
    margin-bottom: 15px; /* Space below each section */
}

.contact-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.email-row, .phone-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px; /* Space between input and remove button */
}

.email-row input, .phone-row input {
    flex-grow: 1; /* Allow input to take available space */
    width: auto; /* Override potential 100% width */
    box-sizing: border-box;
    height: 38px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.remove-email, .remove-phone {
    background-color: #f44336; /* Red */
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.add-contact-btn {
    margin-top: 5px;
    background-color: #4CAF50; /* Green */
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.field-description {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
}

.phone-warning {
    color: #f44336;
    font-size: 0.8em;
    margin-top: -5px;
    margin-bottom: 5px;
    display: none; /* Hidden by default */
}

.invalid-phone {
    border-color: #f44336 !important; /* Highlight invalid phone inputs */
}

/* Family Room Preference Description Box */
.preference-description-box {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.preference-description-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    color: #333;
}

.preference-description-box p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.preference-description-box p:last-child {
    margin-bottom: 0;
}

/* Participant Rows */
.participant-row {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex; /* Use flex for row alignment */
    flex-wrap: wrap; /* Allow button to wrap */
    align-items: flex-end; /* Align button with bottom of fields */
    gap: 10px; /* Space between fields container and button */
}

/* Container for the fields within a row */
.participant-fields {
    flex-grow: 1; /* Allow fields container to take available space */
    display: flex;
    flex-wrap: wrap; /* Allow fields to wrap */
    gap: 15px; /* Space between individual fields */
    align-items: flex-end; /* Align field bottoms */
}

/* Individual field group (label + input) */
.field-group {
    flex: 1 1 180px; /* Grow, shrink, base width */
    min-width: 150px; /* Minimum width before wrapping */
    display: flex;
    flex-direction: column; /* Stack label and input */
}

.field-group label {
    display: block;
    margin-bottom: 5px; /* Space between label and input */
    font-weight: bold;
}

/* Input fields */
.field-group input[type="text"],
.field-group input[type="date"] {
    width: 100%; /* Make input fill the field group */
    box-sizing: border-box;
    height: 38px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Override browser's default date input styling */
input[type="date"] {
    appearance: textfield;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    min-height: 38px; /* Ensure consistent height */
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
    margin: 0; /* Adjust if needed */
    /* You might want to add custom styling for the picker indicator */
}

/* Family room preference checkbox styling */
.field-group.family-room-preference {
    flex-grow: 0; /* Don't grow */
    flex-basis: auto; /* Size based on content */
    min-width: 150px; /* Ensure enough space */
    align-self: center; /* Vertically center with other fields */
    padding-top: 20px; /* Adjust vertical alignment relative to inputs */
}

.family-room-preference label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0; /* Override default label margin */
}

.family-room-preference input[type="checkbox"] {
    margin-right: 5px;
}

.family-room-preference .preference-content {
    display: flex;
    flex-direction: column;
}

.family-room-preference .preference-title {
    white-space: nowrap; /* Prevent wrapping */
    display: inline-block;
    font-weight: normal; /* Override potential bold from label */
}

/* Remove participant button */
.remove-participant {
    background-color: #f44336; /* Red */
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    height: fit-content; /* Adjust height to content */
    flex-shrink: 0; /* Prevent button shrinking */
}

/* Add participant button */
#add-participant {
    background-color: #4CAF50; /* Green */
    color: white;
    border: none;
    padding: 8px 16px;
    margin-top: 10px; /* Space above button */
    cursor: pointer;
    border-radius: 4px;
}

/* Apply to all row styling */
.apply-all-row {
    border-bottom: 1px dashed #ddd;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-top: none; /* Remove other borders */
    border-left: none;
    border-right: none;
}

.apply-all-row .participant-fields {
    justify-content: flex-end; /* Push checkbox to the right */
}

.apply-all-row .field-group.empty-field {
    visibility: hidden; /* Hide placeholders but keep space */
}

/* --- Step 3: Participation Type --- */
.participant-type-selection {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.participant-type-selection h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.radio-group {
    display: flex;
    gap: 20px; /* Space between radio options */
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* Date selection container */
.date-selection-container {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.date-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    position: relative; /* For absolute positioning of checkbox */
}

.date-box input[type="checkbox"] {
    position: absolute;
    opacity: 0; /* Hide the actual checkbox */
    cursor: pointer;
    height: 0;
    width: 0;
}

.date-box.selected {
    border-color: #4CAF50; /* Green border when selected */
    background-color: #e8f5e9; /* Light green background */
    font-weight: bold;
}

.date-box:hover {
    border-color: #4CAF50;
    background-color: #f1f8e9; /* Lighter green on hover */
}

/* --- Step 4: Food Preferences --- */
.global-preference {
    margin: 10px 0 20px;
    padding: 10px 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start; /* Align checkbox with start of text */
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    flex: 0 0 20px; /* Fixed width */
    width: 20px;
    height: 20px;
    margin-right: 10px;
    margin-top: 3px; /* Align slightly lower */
}

.preference-content {
    display: flex;
    flex-direction: column;
}

.preference-title {
    font-weight: bold;
}

.preference-description {
    font-size: 0.9em;
    color: #555;
}

/* Meal Options for Day Visit */
.meal-options {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.date-meals-container {
    margin-top: 10px;
}

.date-meal-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.date-meal-row:last-child {
    border-bottom: none;
}

.date-label {
    flex: 0 0 80px; /* Fixed width for date label */
    font-weight: bold;
}

.meal-checkboxes {
    display: flex;
    gap: 20px; /* Space between meal checkboxes */
}

.meal-checkboxes label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.meal-checkboxes input[type="checkbox"] {
    margin-right: 8px;
}

/* --- Step 5: Contributions --- */
/* Styles for contribution options if needed */


/* --- Step 6: Review --- */
/* Styles for review table if needed */


/* --- Form Navigation --- */
.form-navigation {
    margin-top: 20px;
    margin-bottom: 100px; /* Increased bottom margin */
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.back-button {
    margin-right: auto; /* Pushes back button to the left */
    order: 0;
}

.next-button,
.submit-button {
    margin-left: auto; /* Pushes next/submit button to the right */
    order: 1;
}

/* General Button Styling (Apply to back, next, submit, add, remove etc. if desired) */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.back-button {
    background-color: #ccc;
    color: #333;
}

.next-button,
.submit-button {
    background-color: #46b450;
    color: white;
}

/* --- Responsiveness --- */

/* Base responsive styles */
.registration-form-container { /* Assuming a wrapper div */
    max-width: 100%;
    padding: 15px;
    box-sizing: border-box;
}

/* Mobile responsiveness (screens smaller than 768px) */
@media screen and (max-width: 767px) {

    /* Make step labels smaller on mobile */
    .step-item .step-label {
        font-size: 11px;
    }

    /* Adjust representative contact layout */
    .representative-contact {
        flex-direction: column; /* Stack email and phone sections */
        gap: 15px;
    }
    .contact-section {
        min-width: 0; /* Remove min-width */
    }

    /* Adjust participant fields to a 2-column layout using Grid */
    .participant-fields {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Two equal columns */
        gap: 10px;
        width: 100%; /* Ensure grid takes full width */
    }

    /* Make each field group take full width in its grid cell */
    .field-group {
        min-width: 0; /* Override min-width */
        margin-right: 0; /* Remove margin */
        width: 100%; /* Ensure full width within grid cell */
        padding-top: 0; /* Reset padding */
        align-self: start; /* Align items to the start */
    }

    /* Special handling for family room in grid */
    .field-group.family-room-preference {
        grid-column: span 2; /* Make checkbox span both columns */
        justify-self: start; /* Align to the start of the grid area */
        padding-top: 5px; /* Add a little space above */
        min-width: 0;
    }

    /* Adjust the row container */
    .participant-row {
        flex-direction: column; /* Stack fields container and button */
        align-items: flex-start; /* Align items to the start */
        padding: 15px 10px;
    }

    /* Ensure remove button is below fields */
    .remove-participant {
        margin-top: 10px; /* Add space above remove button */
        align-self: flex-end; /* Push remove button to the right */
    }

    /* Hide empty fields in the 'Apply All' row on mobile */
    .apply-all-row .field-group.empty-field {
        display: none;
    }
    .apply-all-row .field-group.family-room-preference {
        grid-column: span 2; /* Ensure 'Apply All' spans columns */
        justify-self: start;
    }

    /* General form elements */
    input[type="text"],
    input[type="email"],
    input[type="date"],
    input[type="tel"],
    select {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Date selection boxes */
    .date-boxes {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); /* More boxes per row */
        gap: 8px;
    }

    .date-box {
        width: auto; /* Let grid control width */
        min-height: 60px;
        padding: 8px;
        font-size: 14px;
    }

    /* Meal options */
    .date-meal-row {
        flex-direction: column; /* Stack date and checkboxes */
        align-items: flex-start;
        margin-bottom: 15px;
    }

    .date-label {
        margin-bottom: 5px;
        font-weight: bold;
        flex-basis: auto; /* Reset flex basis */
    }

    .meal-checkboxes {
        flex-wrap: wrap; /* Allow checkboxes to wrap */
    }

    .meal-checkboxes label {
        margin-right: 15px;
        margin-bottom: 5px;
    }

    /* Navigation buttons */
    .form-navigation button {
        padding: 10px 15px;
        font-size: 16px;
    }

    /* Radio groups */
    .radio-group {
        flex-direction: column; /* Stack radio buttons */
        align-items: flex-start;
    }

    .radio-group label {
        margin-bottom: 10px;
    }
}

/* Tablets (Optional: Adjustments for 768px to 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    /* Example: Adjust participant fields to 3 columns */
    /*
    .participant-fields {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .field-group.family-room-preference {
        grid-column: span 1;
        justify-self: end;
    }
    */

    /* Adjust date boxes for tablets */
    .date-boxes {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Larger Screens (Optional: Further adjustments if needed) */
@media screen and (min-width: 1024px) {
    /* Ensure representative contact sections are side-by-side */
    .contact-section {
        flex-basis: calc(50% - 10px); /* Two columns, accounting for gap */
        flex-grow: 1;
    }

    /* Ensure participant fields stay in a row */
    .participant-fields {
        display: flex; /* Back to flex for larger screens */
        flex-wrap: nowrap; /* Prevent wrapping unless necessary */
        gap: 15px;
    }
    .field-group {
        flex: 1 1 180px; /* Revert to flex sizing */
        width: auto;
    }
    .field-group.family-room-preference {
        flex-grow: 0;
        flex-basis: auto;
        min-width: 150px;
        align-self: center;
        padding-top: 20px;
    }
    .apply-all-row .field-group.empty-field {
        display: block; /* Show empty fields again */
        visibility: hidden;
    }
}