/* Apply Page Styles */
.apply-section {
    background: url('../Images/ApplyBg.png') center center / cover no-repeat;
    min-height: 100vh;
    padding: 3rem 1rem;
    position: relative;
}

.apply-container {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.apply-container h1 {
    color: #fff;
    font-size: 2.2rem;
    margin-bottom: 0.4rem;
}

.subtitle {
    color: #F4D9FF;
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Form Card */
.form-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(68, 0, 67, 0.2);
    text-align: left;
}

/* Section Titles */
.form-section-title {
    color: #440043;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #F4D9FF;
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
}

.form-section-title:first-child {
    margin-top: 0;
}

/* Grid */
.form-grid {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    color: #333;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.required {
    color: #c0392b;
}

.form-group input {
    padding: 0.65rem 0.85rem;
    border: 1px solid #d1b3d1;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #111827;
    background: #fdf8ff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #6b46c1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.12);
    background: #fff;
}

/* ── Custom Select ── */
.custom-select {
    position: relative;
    font-size: 0.95rem;
    user-select: none;
    display: flex;
    flex-direction: column;
}

.cs-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border: 1px solid #d1b3d1;
    border-radius: 6px;
    background: #fdf8ff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    line-height: 1.5;
    font-size: 0.95rem;
}

.custom-select.cs-open .cs-trigger {
    border-color: #6b46c1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.12);
    background: #fff;
    border-radius: 6px 6px 0 0;
}

.custom-select.cs-error .cs-trigger {
    border-color: #c0392b;
}

.cs-value {
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select.cs-has-value .cs-value {
    color: #111827;
}

.cs-arrow {
    flex-shrink: 0;
    margin-left: 0.5rem;
    transition: transform 0.2s;
}

.custom-select.cs-open .cs-arrow {
    transform: rotate(180deg);
}

.cs-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #6b46c1;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 999;
    list-style: none;
    margin: 0;
    padding: 0;
    box-shadow: 0 6px 16px rgba(68, 0, 67, 0.12);
}

.custom-select.cs-open .cs-dropdown {
    display: block;
}

.cs-dropdown li {
    padding: 0.25rem 0.85rem;
    cursor: pointer;
    color: #111827;
    transition: background 0.15s;
}

.cs-dropdown li.cs-placeholder {
    color: #aaa;
}

.cs-dropdown li:hover {
    background: #f4eaff;
}

.cs-dropdown li.cs-selected {
    background: #ede0ff;
    font-weight: 600;
    color: #440043;
}

/* Disabled state */
.custom-select.cs-disabled .cs-trigger {
    background: #f0e8f0;
    border-color: #ddd;
    cursor: not-allowed;
}

.custom-select.cs-disabled .cs-value {
    color: #aaa;
}

.custom-select.cs-disabled .cs-arrow path {
    stroke: #bbb;
}

/* Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-submit {
    background: #440043;
    color: #fff;
    padding: 0.75rem 2.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-submit:hover {
    background: #6b46c1;
    transform: translateY(-1px);
}

.btn-submit:disabled {
    background: #b0b0b0;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .apply-container h1 {
        font-size: 1.6rem;
    }

    .apply-section {
        padding: 3rem 1.25rem;
    }

    .form-wrapper {
        padding: 1.5rem 1rem;
    }

    .form-actions {
        justify-content: center;
    }

    .btn-submit {
        width: 100%;
        max-width: 280px;
        font-size: 0;
    }

    .btn-submit::after {
        content: 'Submit';
        font-size: 0.95rem;
    }
}

/* Phone input with prefix */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #d1b3d1;
    border-radius: 6px;
    background: #fdf8ff;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-input-wrapper:focus-within {
    border-color: #6b46c1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.12);
    background: #fff;
}

.phone-prefix {
    padding: 0.65rem 0 0.65rem 0.85rem;
    color: #aaa;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    transition: color 0.2s;
}

.phone-input-wrapper:focus-within .phone-prefix,
.phone-input-wrapper.has-value .phone-prefix {
    color: #111827;
}

/* phone error state */
.phone-input-wrapper.phone-error {
    border-color: #9333ea;
    background: #faf5ff;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12);
}
.phone-error-msg {
    display: none;
    font-size: 0.78rem;
    color: #7e22ce;
    margin-top: 0.3rem;
}
.phone-input-wrapper.phone-error ~ .phone-error-msg { display: block; }

.phone-input-wrapper input {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0.65rem 0.85rem 0.65rem 0 !important;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    flex: 1;
    min-width: 0;
}

.phone-input-wrapper input:focus {
    outline: none;
    border: none !important;
    box-shadow: none !important;
}

/* ── Date Picker ── */
.date-picker {
    position: relative;
    font-size: 0.95rem;
    user-select: none;
}

.dp-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border: 1px solid #d1b3d1;
    border-radius: 6px;
    background: #fdf8ff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    line-height: 1.5;
    font-size: 0.95rem;
    font-family: inherit;
}

.date-picker.dp-open .dp-trigger {
    border-color: #6b46c1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.12);
    background: #fff;
    border-radius: 6px 6px 0 0;
}

.dp-value {
    color: #aaa;
}

.date-picker.dp-has-value .dp-value {
    color: #111827;
}

.dp-calendar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #6b46c1;
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 999;
    box-shadow: 0 6px 16px rgba(68, 0, 67, 0.12);
    padding: 0.75rem;
    box-sizing: border-box;
}

.date-picker.dp-open .dp-calendar {
    display: block;
}

.dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dp-month-btn {
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.dp-nav {
    display: flex;
    gap: 0.4rem;
}

.dp-prev, .dp-next {
    background: none;
    border: 1px solid #d1b3d1;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #440043;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.dp-prev:hover, .dp-next:hover {
    background: #f4eaff;
}

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.dp-day-name {
    font-size: 0.78rem;
    color: #888;
    padding: 0.3rem 0;
    font-weight: 600;
}

.dp-day {
    padding: 0.35rem 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #111827;
    transition: background 0.15s;
}

.dp-day:hover {
    background: #f4eaff;
}

.dp-day.dp-other {
    color: #ccc;
    cursor: default;
    pointer-events: none;
}

.dp-day.dp-disabled {
    color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
    text-decoration: line-through;
}

.dp-prev:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.dp-day.dp-today {
    border: 2px solid #440043;
    font-weight: 700;
    color: #440043;
}

.dp-day.dp-selected {
    background: #440043;
    color: #fff;
    font-weight: 700;
}

.dp-day.dp-selected.dp-today {
    border-color: #fff;
}

.dp-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0e8f0;
}

.dp-clear, .dp-today-btn {
    background: none;
    border: none;
    color: #6b46c1;
    font-size: 0.88rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    font-weight: 500;
}

.dp-clear:hover, .dp-today-btn:hover {
    text-decoration: underline;
}

/* ── Date Picker Month/Year Picker ── */
.dp-picker-header {
    margin-bottom: 0.75rem;
}

.dp-back-btn {
    background: none;
    border: 1px solid #d1b3d1;
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
    color: #440043;
    cursor: pointer;
    font-family: inherit;
}

.dp-back-btn:hover {
    background: #f4eaff;
}

.dp-year-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0.75rem;
}

.dp-yr-item {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #111827;
    border: 1px solid transparent;
    transition: background 0.15s;
}

.dp-yr-item:hover {
    background: #f4eaff;
}

.dp-yr-item.dp-yr-selected {
    background: #440043;
    color: #fff;
    font-weight: 700;
}

.dp-month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.dp-mo-item {
    padding: 0.4rem 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #111827;
    text-align: center;
    transition: background 0.15s;
}

.dp-mo-item:hover:not(.dp-mo-disabled) {
    background: #f4eaff;
}

.dp-mo-item.dp-mo-selected {
    background: #440043;
    color: #fff;
    font-weight: 700;
}

.dp-mo-item.dp-mo-disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Result card */
.result-card .result-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* Field hint */
.field-hint {
    font-size: 0.78rem;
    color: #888;
    margin-top: 0.25rem;
}

/* Section note */
.section-note {
    font-size: 0.85rem;
    color: #6b46c1;
    margin: -0.75rem 0 1rem;
    font-style: italic;
}


/* ── Refresh Button ── */
.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}
.label-row label { margin-bottom: 0; }
.btn-refresh {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #d8b4fe;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s;
}
.btn-refresh:hover:not(:disabled) { background: #c084fc; }
.btn-refresh:disabled { background: #d1d5db; cursor: not-allowed; }
.btn-refresh.spinning svg { animation: spin 0.6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }
