/*
 * Unified /join Form Styles
 * TypeForm-inspired progressive form design
 */

/* Container */
.join-form-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 1rem;
}

.join-form-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 3rem 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-header p {
    font-size: 1.125rem;
    color: #666;
    line-height: 1.6;
}

/* Form Sections */
.form-section {
    margin-bottom: 2.5rem;
}

.form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.section-description {
    color: #666;
    margin-bottom: 1rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Fix dropdown height for country select */
select.form-control.country-select {
    height: auto;
    min-height: 45px;
    max-height: 300px;
}

/* Region dropdown styling */
select.form-control.region-dropdown {
    height: auto;
    min-height: 45px;
    max-height: 300px;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

.field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Age Ranges Grid */
.age-ranges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Radio and Checkbox Groups */
.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Per-child Reading Level Sections */
.child-reading-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.child-reading-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.75rem;
}

.child-reading-section .radio-group {
    gap: 0.5rem;
}

.child-reading-section .radio-option {
    padding: 0.75rem 1rem;
    background: white;
}

.radio-option, .checkbox-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    position: relative; /* Establish positioning context */
}

.radio-option:hover, .checkbox-option:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

/* Override Bootstrap's form-check-input positioning */
.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"],
.radio-option .form-check-input,
.checkbox-option .form-check-input {
    position: static !important; /* Override Bootstrap's absolute positioning */
    margin: 0 0.75rem 0 0 !important; /* Override Bootstrap's negative margins */
    flex-shrink: 0; /* Prevent input from shrinking */
    width: 1.25rem; /* Explicit size for consistency */
    height: 1.25rem;
}

.radio-option span, .checkbox-option span {
    flex: 1;
    font-weight: 500;
    color: #333;
}

/* Info Boxes */
.info-box {
    background: #f8f9ff;
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.info-box h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.info-box ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.info-box li {
    margin-bottom: 0.5rem;
    color: #555;
}

.info-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #856404;
    text-align: center;
}

/* Pricing Questions */
.pricing-questions .form-group {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group-text {
    background: #f1f1f1;
    border: 2px solid #e0e0e0;
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

/* Form Actions */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
}

.btn-lg {
    font-size: 1.125rem;
    padding: 1.25rem 2.5rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Privacy Notice */
.privacy-notice {
    text-align: center;
    font-size: 0.875rem;
    color: #666;
    margin-top: 2rem;
}

.privacy-notice a {
    color: #667eea;
    text-decoration: underline;
}

/* Completion Page */
.completion-page {
    text-align: center;
}

.completion-icon {
    margin-bottom: 2rem;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #28a745;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scale-in 0.5s ease;
}

.checkmark-icon {
    color: white;
    font-size: 42px;
    font-weight: bold;
    line-height: 1;
}

@keyframes scale-in {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

.lead {
    font-size: 1.25rem;
    line-height: 1.6;
}

/* What's Next Section */
.whats-next-section {
    margin: 3rem 0;
    text-align: left;
}

.whats-next-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.next-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.step-card.priority {
    background: #d4edda;
    border-left-color: #28a745;
}

.step-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.step-card p {
    color: #555;
    margin-bottom: 0.75rem;
}

/* Application Summary */
.application-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    text-align: left;
}

.application-summary h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.application-summary dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.application-summary dt {
    font-weight: 600;
    color: #666;
}

.application-summary dd {
    color: #333;
    margin: 0;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-primary {
    background: #667eea;
    color: white;
}

.resume-link-notice {
    font-size: 0.875rem;
    color: #666;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Final CTA */
.final-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Email-First Progressive Disclosure */
.email-first-section {
    padding-bottom: 1rem;
}

.confirmation-check {
    width: 40px;
    height: 40px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.confirmation-text {
    flex: 1;
}

.confirmation-text strong {
    display: block;
    font-size: 1.125rem;
    color: #155724;
}

.confirmation-text span {
    font-size: 0.9rem;
    color: #155724;
}

/* Email captured state */
.email-captured {
    background: #f8f9fa;
    border-color: #28a745;
    color: #155724;
}

/* Legal text below email button */
.legal-text {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    line-height: 1.5;
}

/* Typo suggestion styling */
.typo-suggestion {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fff3cd;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #856404;
}

.typo-suggestion a.typo-fix {
    color: #667eea;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.typo-suggestion a.typo-fix:hover {
    color: #764ba2;
}

/* Progressive fields reveal animation */
.progressive-fields {
    overflow: hidden;
}

.reveal-animation {
    animation: revealFields 0.5s ease-out;
}

@keyframes revealFields {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Virginia eligibility note */
.virginia-note {
    color: #28a745;
    font-weight: 500;
}

/* Phase 3: Founding Families Banner */
.ff-welcome-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid #28a745;
}

.ff-welcome-banner .confirmation-check {
    width: 48px;
    height: 48px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.ff-welcome-banner .banner-content {
    flex: 1;
}

.ff-welcome-banner .banner-content strong {
    display: block;
    font-size: 1.25rem;
    color: #155724;
    margin-bottom: 0.5rem;
}

.ff-welcome-banner .banner-content p {
    color: #155724;
    margin-bottom: 0.75rem;
}

.ff-welcome-banner .benefits-list {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
    color: #155724;
}

.ff-welcome-banner .benefits-list li {
    margin-bottom: 0.25rem;
}

.ff-welcome-banner .learn-more-link {
    color: #667eea;
    font-weight: 500;
    text-decoration: underline;
}

/* Subtitle in form header */
.form-header .subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    color: #666;
    margin-top: 0.5rem;
}

/* Editable child names */
.child-name-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.child-name-display {
    font-weight: 600;
    color: #555;
    border-bottom: 1px dotted #999;
}

.edit-name-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #667eea;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.edit-name-btn:hover {
    opacity: 1;
}

.child-name-input {
    padding: 0.25rem 0.5rem;
    border: 1px solid #667eea;
    border-radius: 4px;
    font-size: 0.9rem;
    width: auto;
    min-width: 150px;
}

/* Commitment acknowledgment highlight */
.commitment-checkboxes {
    margin-top: 1.5rem;
}

.commitment-checkboxes .checkbox-group {
    margin-bottom: 0.75rem;
}

.commitment-ack {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.commitment-ack .checkbox-option {
    background: #f8f9ff;
    border-color: #667eea;
}

.commitment-ack .checkbox-option.has-error {
    background: #fff5f5;
    border-color: #dc3545;
}

/* Timeline note */
.timeline-note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 0.75rem;
}

/* Tooltip trigger (SOL) - styled by JS, no CSS pseudo-elements */
.tooltip-trigger {
    border-bottom: 1px dotted #666;
    cursor: help;
}

/* Character counter */
.char-counter {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    text-align: right;
}

.char-counter.char-warning {
    color: #dc3545;
}

.char-counter.char-valid {
    color: #28a745;
}

/* Required marker */
.required-marker {
    color: #dc3545;
    font-weight: 600;
}

/* Commitment review note */
.commitment-review-note {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 3px solid #667eea;
}

.commitment-review-note p {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
}

.commitment-review-note a {
    color: #667eea;
    font-weight: 500;
}

/* Commitment section styling */
.commitment-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Text success/danger helpers */
.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .join-form-wrapper {
        padding: 2rem 1.5rem;
    }

    .form-header h1 {
        font-size: 1.5rem;
    }

    .age-ranges-grid {
        grid-template-columns: 1fr;
    }

    .final-cta {
        flex-direction: column;
    }

    .application-summary dl {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .application-summary dt {
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    /* Fix mobile dropdown positioning */
    select.form-control.country-select,
    select.form-control.region-dropdown {
        position: relative;
        top: 0;
        margin-top: 0;
        -webkit-appearance: menulist;
        appearance: menulist;
    }

    /* Ensure form controls don't overflow on mobile */
    .form-control {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Fix dropdown options positioning on iOS */
    select.form-control {
        font-size: 16px; /* Prevents iOS zoom */
    }
}
