/* Interactive Tutoring Form Styles - Enhanced for WCAG Compliance */
.nsemm-interactive-form {
    max-width: 100%;
    margin: 0 auto;
    font-family: 'Readex Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Use theme colors if available, fallback to hardcoded values */
    --form-primary: var(--university-blue, #1C3B70);
    --form-accent: var(--knowledge-gold, #FACD00);
    --form-success: var(--coastal-green, #D9FFEC);
    --form-mint: var(--soft-mint, #8BD6AC);
}

.form-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    min-height: 600px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 4px;
    background: #e0e0e0;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--form-accent), var(--form-primary));
    width: 0%;
    transition: width 0.3s ease;
}

.form-content {
    padding: 40px;
    height: calc(100% - 4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.step.active {
    display: block;
}

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

.step-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--form-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.step-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.input-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #f9f9f9;
    box-sizing: border-box;
}

/* Enhanced dropdown styling with improved accessibility */
select.form-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #f9f9f9;
    padding-right: 40px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

select.form-input::-ms-expand {
    display: none;
}

select.form-input option {
    background: white;
    color: #333;
    padding: 8px 12px;
    border: none;
}

.form-input:focus {
    outline: none;
    border-color: #1C3B70;
    background: white;
    box-shadow: 0 0 0 3px rgba(28, 59, 112, 0.1);
}

/* Enhanced validation states */
.form-input.valid {
    border-color: #38a169;
    background: #f0fff4;
}

.form-input.invalid {
    border-color: #e53e3e;
    background: #fed7d7;
}

.choice-buttons {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.choice-button {
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    position: relative;
}

.choice-button:hover {
    border-color: #1C3B70;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.choice-button:focus {
    outline: 2px solid #FACD00;
    outline-offset: 2px;
}

.choice-button.selected {
    border-color: #1C3B70;
    background: #f0f4ff;
    box-shadow: 0 4px 12px rgba(28, 59, 112, 0.2);
    transform: translateY(-2px);
}

.choice-button.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 15px;
    color: #1C3B70;
    font-weight: bold;
    font-size: 1.2rem;
}

.choice-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    border: none;
    padding: 0;
}

.subject-button {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.subject-button:hover {
    border-color: #1C3B70;
    background: #f8f9ff;
}

.subject-button:focus {
    outline: 2px solid #FACD00;
    outline-offset: 2px;
}

.subject-button.selected {
    border-color: #1C3B70;
    background: #f0f4ff;
    color: #1C3B70;
    font-weight: 600;
}

.subject-button.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 8px;
    color: #1C3B70;
    font-weight: bold;
    font-size: 1rem;
}

.subject-button.popular {
    border-color: #FACD00;
    background: #fffbf0;
}

.subject-button.popular.selected {
    border-color: #1C3B70;
    background: #f0f4ff;
}

.popular-label {
    font-size: 0.7rem;
    color: #ff6b35;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-slider-container {
    margin: 2rem 0;
}

.price-display {
    text-align: center;
    margin-bottom: 1rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1C3B70;
}

.price-label {
    font-size: 1rem;
    color: #666;
    margin-top: 0.5rem;
}

.price-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    margin: 20px 0;
}

.price-slider:focus {
    outline: 2px solid #FACD00;
    outline-offset: 2px;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #1C3B70;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(28, 59, 112, 0.3);
}

.price-slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #1C3B70;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(28, 59, 112, 0.3);
}

.price-notes {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-top: 1rem;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn:focus {
    outline: 2px solid #FACD00;
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #FACD00, #FFD700);
    color: #2B2A2A;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1C3B70, #2A4B85);
    color: white;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.selected-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.selected-subject-tag {
    background: #1C3B70;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remove-subject {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    padding: 0;
    margin-left: 0.25rem;
}

.remove-subject:hover {
    opacity: 1;
}

.remove-subject:focus {
    outline: 1px solid white;
    outline-offset: 1px;
}

.service-message {
    background: #f0f8ff;
    border: 2px solid var(--form-primary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 2rem;
    text-align: center;
}

.service-message.success {
    background: #f0fff4;
    border-color: #38a169;
    color: #2d5a3d;
}

.service-message.info {
    background: #f0f8ff;
    border-color: #3182ce;
    color: #2c5282;
}

.age-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: color-mix(in srgb, var(--form-primary) 10%, transparent);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--form-primary);
    font-weight: 600;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.submit-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Messages and notifications */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #fc8181;
    border-left: 4px solid #c53030;
}

.success-message {
    background: var(--form-success);
    color: var(--form-primary);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid var(--form-mint);
    border-left: 4px solid #38a169;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.name-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* GDPR Consent Styling */
.consent-section {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.consent-item {
    margin-bottom: 1.5rem;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
    gap: 0.75rem;
}

.consent-label input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
    flex-shrink: 0;
    margin-top: 0.2rem;
    cursor: pointer;
}

.consent-label input[type="checkbox"]:focus {
    outline: 2px solid #FACD00;
    outline-offset: 2px;
}

.consent-label small {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.privacy-info {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.privacy-info a {
    color: #1C3B70;
    text-decoration: underline;
}

.privacy-info a:focus {
    outline: 2px solid #FACD00;
    outline-offset: 2px;
}

.marketing-consent-section {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
}

.captcha-section {
    margin: 2rem 0;
    text-align: center;
}

.success-actions {
    text-align: left;
    margin-top: 2rem;
}

.success-actions ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.success-actions li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.success-actions li:last-child {
    border-bottom: none;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Focus indicators for better accessibility */
.choice-button:focus,
.btn:focus,
.form-input:focus,
.subject-button:focus,
input[type="checkbox"]:focus,
input[type="radio"]:focus {
    outline: 2px solid #FACD00;
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {
    .choice-button,
    .subject-button,
    .form-input {
        border-width: 3px;
    }

    .btn-primary {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }

    .btn-secondary {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }

    .choice-button.selected,
    .subject-button.selected {
        background: #000;
        color: #fff;
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .choice-button,
    .btn,
    .step,
    .spinner,
    .subject-button {
        animation: none !important;
        transition: none !important;
    }

    .choice-button:hover,
    .btn:hover,
    .subject-button:hover {
        transform: none !important;
    }

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

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}

/* Print styles */
@media print {
    .navigation,
    .step-counter,
    .progress-bar {
        display: none;
    }

    .form-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .step {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .form-content {
        padding: 20px;
    }

    .step-title {
        font-size: 1.5rem;
    }

    .subject-grid {
        grid-template-columns: 1fr;
    }

    .choice-buttons {
        grid-template-columns: 1fr;
    }

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

    .navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .navigation .btn {
        width: 100%;
    }

    .step-counter {
        top: 10px;
        right: 10px;
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }

    .price-amount {
        font-size: 2rem;
    }

    .choice-button {
        padding: 15px;
        font-size: 0.9rem;
    }

    .choice-icon {
        font-size: 1.2rem;
        width: 30px;
    }

    .name-inputs {
        grid-template-columns: 1fr;
    }

    .consent-label {
        font-size: 0.9rem;
    }

    .privacy-info {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .form-content {
        padding: 15px;
    }

    .step-title {
        font-size: 1.3rem;
    }

    .step-description {
        font-size: 1rem;
    }

    .form-input {
        padding: 12px 16px;
        font-size: 1rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: 100px;
    }

    .subject-button {
        padding: 12px;
        font-size: 0.85rem;
    }

    .choice-button {
        padding: 12px;
        font-size: 0.85rem;
        gap: 10px;
    }

    .price-amount {
        font-size: 1.8rem;
    }

    .selected-subject-tag {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .consent-section {
        padding: 1rem;
    }
}

/* Enhanced focus management for forms */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

legend {
    font-weight: bold;
    margin-bottom: 1rem;
}

/* Improved radio/checkbox styling for better accessibility */
input[type="radio"],
input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.5rem;
}

/* Toast notification styles */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1C3B70;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(28, 59, 112, 0.3);
    max-width: 300px;
}

.toast-notification.toast-error {
    background: #c53030;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Form validation messages */
.validation-message {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.validation-message.error {
    color: #c53030;
    background: #fed7d7;
    border: 1px solid #fc8181;
}

.validation-message.success {
    color: #2d5a3d;
    background: #f0fff4;
    border: 1px solid #9ae6b4;
}