:root {
    --primary-color: #00b2ff;
    --primary-dark: #0099e6;
    --text-color: #333;
    --background-color: #f0f2f5;
    --white: #ffffff;
    --border-color: #ddd;
    --error-color: #dc3545;
    --success-color: #28a745;
    --font-family:
        "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

.logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.logo-container img {
    max-width: 350px;
    height: auto;
    display: block;
    object-fit: contain;
    margin-left: auto;
    margin-right: auto;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    overflow: hidden;
}

header {
    background: #333;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

main p {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 20px;
}

.project-link {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.project-link h2 {
    color: #333;
    margin-top: 0;
}

.project-link p {
    font-size: 1rem;
    color: #666;
}

.button {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.button:hover {
    background: #0056b3;
}

footer {
    text-align: center;
    padding: 20px;
    background: #333;
    color: #fff;
    margin-top: 30px;
}

.form-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 600;
}

.form-field {
    margin-bottom: 1.5rem;
}

.form-field input[type="tel"],
.form-field input[type="text"],
.form-field input[type="number"],
.form-field select,
input[type="text"],
input[type="tel"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: var(--font-family);
    font-weight: 400;
}

.form-field input[type="text"]:focus,
.form-field input[type="number"]:focus,
.form-field input[type="tel"]:focus,
.form-field select:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 178, 255, 0.2);
}

/* Checkbox Styles */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    user-select: none;
    margin-bottom: 10px;
}

.checkbox-container .toggle-label-text {
    margin-right: 10px;
}

.checkbox-container input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.checkbox-container .checkmark {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 34px;
    transition:
        background-color 0.3s,
        border-color 0.3s;
    order: 2;
}

.checkbox-container .checkmark:after {
    content: "";
    position: absolute;
    top: 1px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-dark, #0099e6);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark:after {
    transform: translateX(18px);
}

.checkbox-container input[type="checkbox"]:focus + .checkmark {
    box-shadow: 0 0 0 2px rgba(0, 178, 255, 0.4);
}

/* Specific adjustments for contact preference toggles */
.contact-toggle {
    display: flex;
    align-items: center;
    min-width: 350px;
    cursor: pointer;
    height: auto;
    position: relative;
    user-select: none;
    margin-bottom: 10px;
}

.contact-toggle .checkmark:after {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.contact-toggle input[type="checkbox"]:checked + .checkmark:after {
    transform: translateX(13px); /* Default for viewports <= 350px */
}

@media (min-width: 550px) {
    .contact-toggle input[type="checkbox"]:checked + .checkmark:after {
        transform: translateX(20px); /* For viewports > 350px */
    }
}

/* Set fixed font size for contact toggle labels */
.contact-toggle .toggle-label-text {
    font-size: 14px;
}

/* Label text */
.checkbox-container span {
    font-size: 16px;
    color: var(--text-color);
    user-select: none;
    font-family: var(--font-family);
    font-weight: 400;
}

/* Adjust alignment for contact toggles when text wraps */
.checkbox-container.contact-toggle {
    align-items: flex-start;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

#scheduleButtonsContainer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.schedule-button {
    width: 100%;
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.schedule-button:hover {
    background: var(--background-color);
    border-color: var(--primary-color);
}

.schedule-button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.schedule-button strong {
    display: block;
    margin-bottom: 4px;
}

.form-field button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0.75rem;
}

.form-field button[type="submit"]:hover {
    background: var(--primary-dark);
}

.hidden {
    display: none !important;
}

/* Child Fields */
#childFields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#childFields input[type="tel"],
#childFields input[type="text"],
#childFields input[type="number"] {
    margin: 0;
}

/* Input Fields */
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    color: #212529;
    background: white;
    transition: border-color 0.2s ease;
    margin: 0;
    font-family: var(--font-family);
    font-weight: 400;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #0088ff;
}

input::placeholder {
    color: #6c757d;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: #212529;
}

.radio-group input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s ease;
}

.radio-group input[type="radio"]:checked {
    border-color: #0088ff;
}

.radio-group input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.625rem;
    height: 0.625rem;
    background: #0088ff;
    border-radius: 50%;
}

/* Submit Button */
.submit-button {
    width: 100%;
    padding: 1rem;
    background: #0088ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-button:hover {
    background: #0077ee;
}

/* Animations and Visibility */
.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
    display: block !important;
    opacity: 1;
    pointer-events: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.completed {
    opacity: 1;
}

.progress-step.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.step-label {
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}

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

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-step h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Step Navigation */
.step-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: space-between;
}

.step-navigation button {
    flex: 1;
}

.btn-prev,
.btn-next,
.btn-submit,
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-family);
}

.btn-next,
.btn-submit,
.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-next:hover,
.btn-submit:hover,
.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-prev {
    background: var(--white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-prev:hover {
    background: var(--background-color);
}

.btn-secondary {
    width: 100%;
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Error Messages */
.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
    display: block;
}

.form-field.has-error input,
.form-field.has-error select {
    border-color: var(--error-color);
}

.form-field.has-success input,
.form-field.has-success select {
    border-color: var(--success-color);
}

/* Review Section */
.review-section {
    background: var(--background-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.review-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.review-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.review-group h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.review-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--white);
    border-radius: 6px;
}

.review-item:last-child {
    margin-bottom: 0;
}

.review-label {
    font-weight: 500;
    color: var(--text-color);
    margin-right: 1rem;
}

.review-value {
    flex: 1;
    text-align: left;
    color: var(--text-color);
}

.btn-edit {
    padding: 6px 12px;
    background: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-edit:hover {
    background: var(--primary-color);
    color: var(--white);
}

.success-text {
    color: var(--success-color);
    font-weight: 600;
}

/* Thank You Message */
.thank-you-message {
    text-align: center;
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    font-weight: bold;
}

.thank-you-message h2 {
    color: var(--success-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.thank-you-message p {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.thank-you-note {
    font-size: 0.95rem;
    color: #666;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .logo-container {
        padding: 0;
    }

    h1 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .progress-indicator {
        padding: 0;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .review-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .btn-edit {
        align-self: flex-end;
    }

    .step-navigation {
        flex-direction: column;
    }
}

.copyright {
    position: fixed;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
    color: #888;
    text-align: right;
    padding: 0.25rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    box-shadow: none;
    z-index: 999;
    font-family: var(--font-family);
    font-weight: 300;
    transition: opacity 0.3s ease;
    opacity: 0.7;
}

.copyright:hover {
    opacity: 1;
}

@media screen and (max-width: 480px) {
    .copyright {
        font-size: 0.65rem;
        bottom: 0.25rem;
        right: 0.25rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        width: 90%;
    }

    header h1 {
        font-size: 2rem;
    }

    .project-link h2 {
        font-size: 1.5rem;
    }

    .button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* Labels */
label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Terms Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.modal-close:hover {
    color: #333;
}

.terms-text {
    overflow-y: auto;
    max-height: 50vh;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 20px 10px;
    margin-bottom: 20px;
    text-align: justify;
}

#accept-terms-button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0.75rem;
}

#accept-terms-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#terms-container a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

#terms-container a:hover {
    text-decoration: underline;
}

#open-terms-button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
}

#open-terms-button:hover {
    background: var(--primary-dark);
}

.terms-text {
    height: 60vh; /* Give a fixed height for the embed to work well */
    padding: 0;
    overflow: hidden;
}

.terms-text embed {
    width: 100%;
    height: 100%;
}

#accept-terms-button {
    margin-top: 15px;
    width: 100%;
}

/* Schedule Buttons in Step 3 */
.schedule-buttons {
    margin-top: 1rem;
}

.schedule-buttons label {
    margin-bottom: 0.75rem;
}
