/*
 * Apply For Tuition Page Styles
 * Used only by Views/ApplyForTuition/Index.cshtml
 *
 * Visual language matches the Etiverse_Web design system: a soft
 * lavender-gray canvas, generously rounded (16px) white surfaces with
 * lavender-tinted soft shadows, Poppins typography, and one saturated
 * brand red as the sole strong accent (flat, no gradients).
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Etiverse-style tokens, scoped to this page only so other pages that
   still read the legacy --form-fg-* tokens from main.css are unaffected. */
body.apply-for-tuition-page {
    --form-fg-primary: #b0000d;
    --form-fg-primary-border: #8b0009;
    --form-fg-secondary: #6b7280;
    --field-border: #cccccc;
    --divider-bg: #e5e7eb;
    --input-shadow: 0 0 0 3px rgba(176, 0, 13, 0.08);
}

/* Apply for Tuition page body */
body.apply-for-tuition-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #f0f0f5;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
}

/* Application page container */
.page-container {
    padding: 50px 40px 80px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Page header */
.page-header {
    text-align: center;
    color: var(--form-fg-primary, #333333);
    margin-bottom: 40px;
    width: 100%;
    position: relative;
}

.page-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
}

/* Page subtitle */
.page-header-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    font-weight: 500;
}

/* Main white form container */
.form-main-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 48px;
    box-shadow: 4px 4px 12px rgba(147, 147, 207, 0.3);
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

/* Form section (transparent with no border) */
.form-section {
    background: transparent;
    padding: 28px 0;
    margin-bottom: 0;
}

.form-section h3 {
    color: #333333;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--form-fg-primary);
    display: inline-block;
    position: relative;
}

.form-section h4 {
    color: #333333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    margin-top: 20px;
    padding-left: 14px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-left: 4px solid var(--form-fg-primary);
    background: rgba(176, 0, 13, 0.05);
    border-radius: 0 8px 8px 0;
}

.form-section h5 {
    color: #6b7280;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 12px;
    margin-top: 16px;
    padding-left: 12px;
    border-left: 3px solid #6b7280;
}

/* Form dividers (separator between sections) */
.form-divider-h3 {
    height: 1px;
    background: var(--divider-bg);
    margin: 1px;
    border: none;
    border-radius: 2px;
}
.form-divider-h4 {
    margin: 4px;
    border: 1px dotted var(--divider-bg);
    border-style: none none dotted;
}
.form-divider-h5 {
    margin: 6px 0;
    border: none;
    height: 1px;
    background: var(--divider-bg);
}

/* Form group styling */
.form-section .form-group {
    margin-bottom: 20px;
}

/* Containers that is for displaying two fields side by side*/
.form-group-2col {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Creates two equal columns */
    gap: 20px;
}
.form-group-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* Creates three equal columns */
    gap: 20px;
}

.form-section label {
    display: block;
    color: var(--form-fg-secondary);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.form-section input[type="text"],
.form-section input[type="email"],
.form-section input[type="tel"],
.form-section input[type="number"],
.form-section input[type="date"],
.form-section select,
.form-section textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--divider-bg);
    border-radius: 16px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    background-color: #fff;
}

.form-section input[type="text"]:hover,
.form-section input[type="email"]:hover,
.form-section input[type="tel"]:hover,
.form-section input[type="number"]:hover,
.form-section input[type="date"]:hover,
.form-section select:hover,
.form-section textarea:hover {
    border-color: var(--field-border);
}

.form-section input[type="text"]:focus,
.form-section input[type="email"]:focus,
.form-section input[type="tel"]:focus,
.form-section input[type="number"]:focus,
.form-section input[type="date"]:focus,
.form-section select:focus,
.form-section textarea:focus {
    border-color: var(--form-fg-primary);
    box-shadow: var(--input-shadow);
    outline: none;
    background-color: #fff;
}



/* Custom calendar icon for webkit browsers (Chrome/Edge/Safari) */
.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23b0000d' d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
    width: 20px;
    height: 20px;
    opacity: 1;
}
.form-group input[type="date"]:invalid {
    color: var(--form-fg-secondary);
}



/* Dropdown (Select) specific styling */
.form-section select {
    background-color: transparent;
    cursor: pointer;
    appearance: none;
}

/* Dropdown options styling */
.form-section select option {
    padding: 12px 15px;
    background-color: transparent;
    color: #333;
    font-size: 1rem;
    cursor: pointer;
}

.form-section select option:hover {
    background-color: var(--form-fg-primary);
    color: white;
}

.form-section select option:checked {
    background-color: var(--form-fg-primary);
    color: white;
    font-weight: 600;
}

.form-section select option:disabled {
    color: #999;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* Style for when the placeholder is active (value is empty) */
.form-section select:invalid {
    color: var(--form-fg-secondary);
}


/* Searchable select: a text input + filtered dropdown overlaid on top of a
   <select> that stays in the DOM (visually hidden, but still sized/positioned)
   as the actual source of truth for value/required/disabled. */
.searchable-select {
    position: relative;
}

.searchable-select__native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.searchable-select__input {
    position: relative;
    z-index: 1;
    cursor: text;
}

/* Non-searchable variant (makeSelectSearchable(select, { searchable: false })) -
   same look, but read-only: click to open the full list, no typing/filtering. */
.searchable-select__input[readonly] {
    cursor: pointer;
    caret-color: transparent;
}

.searchable-select__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--divider-bg);
    border-radius: 12px;
    box-shadow: 4px 4px 12px rgba(147, 147, 207, 0.3);
    padding: 6px;
    z-index: 20;
}

.searchable-select__option {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
}

.searchable-select__option:hover,
.searchable-select__option.is-active {
    background-color: var(--form-fg-primary);
    color: #fff;
}

.searchable-select__option.is-selected {
    font-weight: 600;
}

.searchable-select__empty {
    padding: 10px 12px;
    color: var(--form-fg-secondary);
    font-size: 0.9rem;
}

/* Radio button styling */
.form-section input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 60%;
    outline: none;
    cursor: pointer;
    position: relative;
    margin-right: 3px;
    vertical-align: middle;
    transition: all 0.3s ease;
    background-color: #f5f5f5;
}

.form-section input[type="radio"]:hover {
    border-color: var(--field-border);
    background-color: #fff;
}

.form-section input[type="radio"]:focus {
    border-color: var(--form-fg-primary);
    box-shadow: var(--input-shadow);
}

.form-section input[type="radio"]:checked {
    border-color: var(--form-fg-primary);
    background-color: var(--form-fg-primary);
}

.form-section input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
}

/* New clean radio button group layout */
.radio-group {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 0;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.radio-option:hover {
    background-color: rgba(176, 0, 13, 0.05);
}

.radio-option input[type="radio"] {
    margin-right: 8px;
}

.radio-option span {
    color: #999;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

/* Make checked option text darker and bold */
.radio-option:has(input[type="radio"]:checked) span {
    color: #333;
    font-weight: 600;
}


/* Tuition type tab-style selector: stretches full width, reads as tabs rather than radio buttons */
.tuition-type-tabs {
    display: flex;
    width: 100%;
    gap: 6px;
    padding: 6px;
    background: #f2f2f2;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
}

.tuition-type-tab {
    flex: 1 1 0;
    justify-content: center;
    text-align: center;
    padding: 14px 12px;
    margin: 0;
    border-radius: 8px;
    background: transparent;
}

.tuition-type-tab input[type="radio"] {
    /* Kept in the DOM for form semantics/keyboard access, but visually hidden - the whole tab is the control */
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.tuition-type-tab span {
    color: var(--form-fg-secondary);
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.tuition-type-tab:hover {
    background-color: rgba(176, 0, 13, 0.08);
}

.tuition-type-tab:has(input[type="radio"]:focus-visible) {
    outline: 2px solid var(--form-fg-primary);
    outline-offset: 2px;
}

.tuition-type-tab:has(input[type="radio"]:checked) {
    background: var(--form-fg-primary);
    box-shadow: 4px 4px 12px rgba(147, 147, 207, 0.3);
}

.tuition-type-tab:has(input[type="radio"]:checked) span {
    color: #fff;
}

/* Warning shown in Academic Information when no tuition type is selected yet */
.academic-info-warning {
    display: block;
    margin-bottom: 20px;
    padding: 12px 16px;
    color: #b45309;
    background-color: #fef3c7;
    border-left: 3px solid #fde68a;
    border-radius: 3px;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Form label for radio groups */
.form-label {
    display: block;
    color: var(--form-fg-secondary);
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

/* Checkbox styling */
.checkbox-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.checkbox-option:hover {
    background-color: rgba(176, 0, 13, 0.05);
}

.checkbox-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    position: relative;
    margin-right: 10px;
    transition: all 0.3s ease;
    background-color: #f5f5f5;
}

.checkbox-option input[type="checkbox"]:hover {
    border-color: var(--field-border);
    background-color: #fff;
}

.checkbox-option input[type="checkbox"]:focus {
    border-color: var(--form-fg-primary);
    box-shadow: var(--input-shadow);
}

.checkbox-option input[type="checkbox"]:checked {
    border-color: var(--form-fg-primary);
    background-color: var(--form-fg-primary);
}

.checkbox-option input[type="checkbox"]:checked::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-option span {
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Checkbox description styling - similar to invalid input styling */
.checkbox-description {
    display: block;
    margin-top: 6px;
    margin-left: 28px;
    color: var(--form-fg-secondary);
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.4;
    padding: 4px 8px;
    background-color: rgba(131, 134, 135, 0.08);
    border-left: 3px solid var(--form-fg-secondary);
    border-radius: 3px;
}

.checkbox-description span {
    color: var(--form-fg-primary);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* Pop-Up Styling for User Info Texts*/

/* Overlay */
.popup-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

    .popup-overlay.hidden {
        display: none;
    }

/* Popup box */
.popup {
    background: #fff;
    border-radius: 16px;
    box-shadow: 4px 4px 12px rgba(147, 147, 207, 0.3);
    width: 90%;
    max-width: 720px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

    .popup-header h2 {
        margin: 0;
        font-size: 1.1rem;
        font-family: sans-serif;
        color: #333;
    }

.popup-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0 4px;
}

    .popup-close:hover {
        color: #000;
    }

.popup-body {
    overflow-y: auto;
    padding: 20px;
    font-family: sans-serif;
    color: #444;
    line-height: 1.6;
    flex: 1;
}

    .popup-body iframe {
        width: 100%;
        height: 60vh;
        border: none;
        display: block;
    }

/* KVKK consent text rendered inside the popup (Views/ApplyForTuition/_ConsentText.cshtml).
   That markup keeps the business-supplied Word inline styles, so the rules below only
   keep it within the popup width and readable on small screens. */
.consent-text {
    font-family: Calibri, "Segoe UI", sans-serif;
    color: #222;
}

    .consent-text p,
    .consent-text li {
        line-height: 1.5;
    }

    .consent-text ul {
        margin: 0;
        padding-left: 18px;
    }

    .consent-text a {
        color: #0969da;
        overflow-wrap: anywhere;
    }

/* The source table is authored at 100.68% width; clamp it and let it scroll
   horizontally rather than stretching the popup. */
.consent-text-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    .consent-text-table table {
        width: 100% !important;
        table-layout: fixed;
    }

    .consent-text-table td {
        vertical-align: top;
        overflow-wrap: anywhere;
    }

/* Submit button for form */
.form-submit-btn {
    background: var(--form-fg-primary);
    color: white;
    padding: 12px 32px;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 36px auto 0;
}

.form-submit-btn:hover {
    background: var(--form-fg-primary-border);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 992px) {
    /* Tuition form: 3-column groups collapse to 2 columns on tablets */
    .form-group-3col {
        grid-template-columns: 1fr 1fr;
    }

    .form-main-container {
        padding: 36px 28px;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .page-container {
        padding: 40px 20px;
    }

    /* Tuition form: 2-column groups collapse to a single column */
    .form-group-2col,
    .form-group-3col {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-main-container {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .form-section {
        padding: 20px 0;
    }

    .form-section h3 {
        font-size: 1.3rem;
    }

    .radio-group {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .tuition-type-tabs {
        flex-wrap: wrap;
    }

    .tuition-type-tab {
        flex: 1 1 45%;
    }

    .form-submit-btn {
        width: 100%;
        padding: 14px 24px;
    }

    .popup {
        width: 95%;
        max-height: 88vh;
    }

    .popup-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        row-gap: 8px;
    }

    /* Keep the consent table's columns legible; the wrapper scrolls sideways instead */
    .consent-text-table table {
        min-width: 560px;
    }
}

@media (max-width: 480px) {
    .page-container {
        padding: 20px 10px 48px;
    }

    .form-main-container {
        padding: 20px 14px;
        border-radius: 12px;
    }

    .form-section h3 {
        font-size: 1.15rem;
    }

    .form-section h4 {
        font-size: 1.05rem;
    }

    .radio-option {
        padding: 4px 6px;
    }

    .checkbox-description {
        margin-left: 0;
    }
}
