:root {
    --primary-color: #00B2FF;
    --primary-dark: #0099e6;
    --text-color: #333;
    --background-color: #f0f2f5;
    --white: #ffffff;
    --border-color: #ddd;
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-speed-fast: 0.3s;
    --transition-speed-slow: 0.5s;
}

* {
    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: 500px;
    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 {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.form-field {
    margin-bottom: 0.75rem;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.form-field input[type="tel"],
.form-field input[type="text"],
.form-field input[type="number"],
.form-field 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 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;
}

#childFields {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#childFields .form-field {
    margin-bottom: 0.75rem;
}

#classSelection {
    margin-top: 0.75rem;
}

#scheduleButtons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 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 var(--transition-speed-slow) ease forwards;
}

.fade-out-fast {
    animation: fadeOut var(--transition-speed-fast) ease forwards;
}

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

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

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

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

    #contactPreferenceField > p {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
}

.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;
    }
}

/* Role Selection */
#role-selection h2 {
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 1rem;
}

.role-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.role-options label {
    background: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.role-options input[type="radio"] {
    display: none;
}

.role-options input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-dark);
}

/* 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;
    transition: opacity var(--transition-speed-fast) ease;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform var(--transition-speed-fast) ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}

.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;
}

#thankYouMessage {
    text-align: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 500;
    padding: 2rem;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--primary-color);
}
