/* ================================================
   Maryland School Student Enrollment Form Styles
   Pixel-perfect match to Figma designs
   ================================================ */

/* Import Lato Font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;500;600;700&display=swap');

/* ================================================
   CSS Variables - Design System
   ================================================ */
:root {
    /* Primary Colors */
    --primary-blue: #5B8FFC;
    --primary-blue-hover: #4A7EEB;
    --brand-blue: #5B8FFC;

    /* Text Colors */
    --text-dark: #1A1A1A;
    --text-gray: #6B7280;
    --text-light: #9CA3AF;
    --text-error: #DC2626;

    /* Background Colors */
    --bg-white: #FFFFFF;
    --bg-light-gray: #F9FAFB;
    --bg-overlay: rgba(0, 0, 0, 0.4);

    /* Border Colors */
    --border-default: #E5E7EB;
    --border-active: #5B8FFC;
    --border-error: #DC2626;

    /* Button Colors */
    --btn-primary-bg: #5B8FFC;
    --btn-primary-text: #FFFFFF;
    --btn-disabled-bg: #D1D5DB;
    --btn-disabled-text: #9CA3AF;
}

/* ================================================
   Global Reset & Base Styles
   ================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

/* ================================================
   Main Container - Split Screen Layout
   ================================================ */
.enrollment-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ================================================
   Left Side - Image with Overlay & Testimonial
   ================================================ */
.enrollment-left {
    flex: 1;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
}

.enrollment-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    z-index: 1;
}

/* Testimonial Card */
.testimonial-card {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    z-index: 2;
    color: white;
}

.testimonial-quote {
    font-size: 18px;
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 400;
}

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.author-info h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.author-info p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.testimonial-stars {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.star {
    color: #FFC107;
    font-size: 16px;
}

.testimonial-navigation {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.nav-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ================================================
   Right Side - Form Container (Scrollable)
   ================================================ */
.enrollment-right {
    flex: 1;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    max-height: 100vh;
}

/* Logo (Fixed at top) */
.enrollment-logo {
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 10;
    padding: 24px 32px;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border-bottom: 1px solid var(--border-default);
}

.enrollment-logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--text-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.logo-text-gray {
    color: var(--text-gray);
}

.logo-text-blue {
    color: var(--brand-blue);
}

/* Form Container (Scrollable Content) */
.enrollment-form-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 32px;
    overflow-y: auto;
}

.enrollment-form-container {
    width: 100%;
    max-width: 420px;
}

/* Form Title & Subtitle */
.form-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 8px;
    text-align: center;
}

.form-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-gray);
    line-height: 1.5;
    margin-bottom: 24px;
    text-align: center;
}

/* ================================================
   Section Divider
   ================================================ */
.section-divider {
    display: flex;
    align-items: center;
    margin: 32px 0 24px;
    text-align: center;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-default);
}

.section-divider-text {
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
    white-space: nowrap;
}

/* ================================================
   Form Elements
   ================================================ */
.enrollment-form {
    width: 100%;
}

/* Input Group */
.input-group {
    margin-bottom: 16px;
    position: relative;
}

.input-group.has-error {
    margin-bottom: 8px;
}

/* Input Label */
.input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    width: 100%;
}

/* Input Field */
.form-input {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    padding-right: 44px;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light-gray);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
}

.form-input.no-icon {
    padding-right: 16px;
}

.form-input::placeholder {
    color: var(--text-light);
}

/* Textarea */
.form-textarea {
    min-height: 80px;
    padding: 12px 16px;
    resize: vertical;
    line-height: 1.5;
}

/* Select/Dropdown */
.form-select {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    padding-right: 44px;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light-gray);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-select:invalid,
.form-select option[value=""] {
    color: var(--text-light);
}

.form-select option {
    color: var(--text-dark);
}

/* Input Focus State */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    background: var(--bg-white);
    border: 2px solid var(--border-active);
    padding: 11px 15px;
    box-shadow: 0 0 0 3px rgba(91, 143, 252, 0.1);
}

.form-input:focus.no-icon {
    padding-right: 15px;
}

.form-input.no-icon:focus {
    padding-right: 15px;
}

.form-select:focus {
    padding-right: 43px;
}

/* Input Error State */
.form-input.error,
.form-textarea.error,
.form-select.error {
    border: 2px solid var(--border-error);
    background: var(--bg-white);
    padding: 11px 15px;
}

.form-select.error {
    padding-right: 43px;
}

.form-input.error:focus,
.form-textarea.error:focus,
.form-select.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Input Icon */
.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 16px;
    pointer-events: none;
}

.input-icon.clickable {
    pointer-events: auto;
    cursor: pointer;
    transition: color 0.2s ease;
}

.input-icon.clickable:hover {
    color: var(--text-gray);
}

/* Chevron icon for select */
.select-wrapper {
    position: relative;
}

.select-wrapper .input-icon {
    pointer-events: none;
}

/* Error Message */
.error-message {
    display: none;
    font-size: 12px;
    color: var(--text-error);
    margin-top: 6px;
    margin-bottom: 10px;
}

.error-message.show {
    display: block;
}

/* ================================================
   Terms Checkbox & Button
   ================================================ */
.terms-wrapper {
    margin: 24px 0;
}

/* Custom Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.checkbox-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.custom-checkbox input:checked ~ .checkbox-box {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkbox-box::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkbox-box::after {
    display: block;
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 400;
    line-height: 1.5;
}

/* ================================================
   Buttons
   ================================================ */
.btn-primary {
    width: 100%;
    height: 48px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    margin-top: 8px;
}

.btn-primary:hover {
    background: var(--primary-blue-hover);
    box-shadow: 0 4px 12px rgba(91, 143, 252, 0.3);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:disabled {
    background: var(--btn-disabled-bg);
    color: var(--btn-disabled-text);
    cursor: not-allowed;
    box-shadow: none;
}

/* ================================================
   Sign In Link
   ================================================ */
.signin-link-wrapper {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-gray);
}

.signin-link {
    color: var(--primary-blue);
    font-weight: 500;
    text-decoration: none;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.signin-link:hover {
    color: var(--primary-blue-hover);
    text-decoration: underline;
}

/* ================================================
   Responsive Design - Mobile
   ================================================ */
@media (max-width: 768px) {
    .enrollment-container {
        flex-direction: column;
    }

    .enrollment-left {
        min-height: 300px;
        flex: none;
    }

    .testimonial-card {
        bottom: 20px;
        left: 20px;
        right: 20px;
    }

    .testimonial-quote {
        font-size: 16px;
    }

    .enrollment-right {
        max-height: none;
    }

    .enrollment-logo {
        position: relative;
        padding: 20px 24px;
        justify-content: center;
    }

    .enrollment-form-wrapper {
        padding: 24px;
    }

    .enrollment-form-container {
        max-width: 100%;
    }

    .form-title {
        font-size: 20px;
    }

    .form-subtitle {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .enrollment-left {
        min-height: 250px;
    }

    .testimonial-quote {
        font-size: 14px;
    }

    .author-info h4 {
        font-size: 16px;
    }

    .enrollment-logo {
        padding: 16px 20px;
        font-size: 18px;
    }

    .enrollment-form-wrapper {
        padding: 20px;
    }

    .form-title {
        font-size: 18px;
    }
}

/* ================================================
   Utility Classes
   ================================================ */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

/* Password Toggle Animation */
.input-icon.toggle-password {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Focus Visible for Accessibility */
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible,
.btn-primary:focus-visible,
.custom-checkbox input:focus-visible ~ .checkbox-box {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ================================================
   Loading State
   ================================================ */
.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Phone Number Input Styling */
.phone-input-wrapper {
    display: flex;
    gap: 8px;
}

.phone-prefix {
    flex-shrink: 0;
    width: 60px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light-gray);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.phone-input-wrapper .form-input {
    flex: 1;
}
