/**
 * NDE Başvuru Formu — Frontend Stilleri
 * NDE Eğitim Teması ile uyumlu tasarım.
 *
 * @version 1.0.0
 */

/* ═══════════ GENEL ═══════════ */
.nde-form-wrapper {
    max-width: 720px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.nde-form-header {
    text-align: center;
    margin-bottom: 32px;
}

.nde-form-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1B3A5C;
    margin: 0 0 8px;
}

.nde-form-donem {
    display: inline-block;
    background: #E8F4F8;
    color: #2C8C7B;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
}

.nde-form-subtitle {
    color: #6c757d;
    font-size: 15px;
    margin-top: 6px;
}

/* ═══════════ FORM UYARI (Kapalı dönem) ═══════════ */
.nde-form-uyari {
    text-align: center;
    padding: 48px 24px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.nde-form-uyari-icon { font-size: 48px; margin-bottom: 12px; }
.nde-form-uyari h3 { color: #1B3A5C; margin: 0 0 8px; }
.nde-form-uyari p { color: #6c757d; margin: 0; }

/* ═══════════ ADIMLAR ═══════════ */
.nde-step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nde-step:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.nde-step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #1B3A5C;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-top: 2px;
}

.nde-step-content {
    flex: 1;
    min-width: 0;
}

.nde-step-label {
    font-weight: 600;
    color: #1B3A5C;
    margin: 0 0 12px;
    font-size: 15px;
}

.nde-step-label .required {
    color: #DC3545;
}

.nde-optional {
    font-weight: 400;
    color: #94a3b8;
    font-size: 13px;
}

/* ═══════════ FIELDSET / LEGEND (#1.4.61) ═══════════
 *
 * Tarayıcı varsayılan <fieldset> bir border çiziyor ve <legend>'ı bu
 * border'ın üzerine bindiriyordu — yazılar çizgilere yapışık görünüyor,
 * sıkışık duruyordu (Image 5, 6, 7).
 *
 * Çözüm: Border ve padding'i sıfırla. Fieldset semantik kalıyor (a11y
 * için önemli — radio gruplarını label'lar) ama görsel olarak normal
 * blok eleman gibi davranıyor. Legend ise .nde-step-label heading'i
 * gibi rahat görünüyor.
 *
 * `min-width:0` Flexbox/Grid içinde fieldset'in default min-width:
 * min-content davranışını ezer (uzun radio etiketleri taşmasın).
 */
.nde-form-wrapper .nde-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.nde-form-wrapper .nde-fieldset > .nde-step-label {
    display: block;
    padding: 0;
    margin: 0 0 14px;
}

/* Yatay form çizgisi/ayraç gerekiyorsa kart konteyneri (.nde-step-card
 * vs.) çizer — fieldset'in görsel border'ı artık yok. */

/* ═══════════ FORM ÖĞELERİ ═══════════ */
.nde-form-wrapper input[type="text"],
.nde-form-wrapper input[type="tel"],
.nde-form-wrapper input[type="email"],
.nde-form-wrapper textarea,
.nde-form-wrapper select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.nde-form-wrapper input:focus,
.nde-form-wrapper select:focus,
.nde-form-wrapper textarea:focus {
    outline: none;
    border-color: #2A5A8C;
    box-shadow: 0 0 0 3px rgba(42, 90, 140, 0.12);
}

.nde-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.nde-form-col {
    flex: 1;
}

.nde-form-col label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

/* ═══════════ RADIO & CHECKBOX ═══════════ */
.nde-radio-group,
.nde-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nde-radio,
.nde-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.2s;
}

/* Checkbox/radio input'u metnin ilk satırıyla hizala (#1.4.61) —
 * uzun onay metinleri alt satıra geçtiğinde checkbox aşağı kaymasın */
.nde-radio input,
.nde-checkbox input {
    accent-color: #1B3A5C;
    margin-top: 3px;
    flex-shrink: 0;
}

.nde-radio:hover,
.nde-checkbox:hover {
    border-color: #2A5A8C;
    background: #f0f7ff;
}

.nde-radio input:checked + *,
.nde-checkbox input:checked + * {
    color: #1B3A5C;
}

/* ═══════════ OTP GRUPLARI ═══════════ */
.nde-otp-group {
    margin-bottom: 16px;
}

.nde-otp-group > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.nde-input-with-button {
    display: flex;
    gap: 8px;
}

.nde-input-with-button input {
    flex: 1;
}

.nde-otp-verify {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.nde-otp-verify input {
    max-width: 160px;
    letter-spacing: 4px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

/* ═══════════ DOSYA YÜKLEMELERİ ═══════════ */
.nde-file-input {
    position: relative;
}

.nde-file-input input[type="file"] {
    padding: 10px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #fafbfc;
    cursor: pointer;
    width: 100%;
}

.nde-file-input input[type="file"]:hover {
    border-color: #2A5A8C;
    background: #f0f7ff;
}

.nde-file-hint {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.nde-conditional-file {
    margin: 10px 0 12px 28px;
    padding: 12px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.nde-conditional-file label {
    display: block;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 6px;
}

/* ═══════════ BUTONLAR ═══════════ */
.nde-form-wrapper .nde-btn{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.nde-form-wrapper .nde-btn-sm{
    padding: 8px 14px;
    font-size: 13px;
}

.nde-form-wrapper .nde-btn-lg{
    padding: 14px 32px;
    font-size: 16px;
}

.nde-form-wrapper .nde-btn-primary{
    background: #1B3A5C;
    color: #fff;
}
.nde-form-wrapper .nde-btn-primary:hover{
    background: #0F2440;
}

.nde-form-wrapper .nde-btn:not(.nde-btn-primary):not(.nde-btn-outline){
    background: #2C8C7B;
    color: #fff;
}
.nde-form-wrapper .nde-btn:not(.nde-btn-primary):not(.nde-btn-outline):hover{
    background: #237566;
}

.nde-form-wrapper .nde-btn-outline{
    background: transparent;
    border: 1px solid #1B3A5C;
    color: #1B3A5C;
}
.nde-form-wrapper .nde-btn-outline:hover{
    background: #1B3A5C;
    color: #fff;
}

.nde-form-wrapper .nde-btn:disabled{
    opacity: 0.6;
    cursor: not-allowed;
}

/* ═══════════ HATA / BAŞARI MESAJLARI ═══════════ */
.nde-error {
    color: #DC3545;
    font-size: 13px;
    margin-top: 6px;
    display: none;
}
.nde-error.active,
.nde-error:not(:empty) {
    display: block;
}

.nde-success {
    color: #28A745;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 600;
}

.nde-message {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
    font-size: 15px;
}
.nde-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.nde-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ═══════════ RESPONSİVE ═══════════ */
@media (max-width: 600px) {
    .nde-step {
        flex-direction: column;
        gap: 10px;
        padding: 16px;
    }
    .nde-step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .nde-form-row {
        flex-direction: column;
        gap: 8px;
    }
    .nde-radio-group,
    .nde-checkbox-group {
        flex-direction: column;
    }
    .nde-input-with-button {
        flex-direction: column;
    }
    .nde-otp-verify {
        flex-direction: column;
        align-items: stretch;
    }
    .nde-otp-verify input {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
 * #1.6.0: PROGRESS INDICATOR + ALAN-BAZLI HATA
 * ═══════════════════════════════════════════════════════════════ */

.nde-progress {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    padding: 14px 18px 12px;
    margin: 0 -18px 20px;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0,0,0,.04);
}

.nde-progress-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.nde-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1B3A5C 0%, #2C8C7B 100%);
    border-radius: 3px;
    transition: width .4s ease;
}

.nde-progress-steps {
    display: flex;
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    gap: 0;
    justify-content: space-between;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nde-progress-step {
    flex: 1;
    min-width: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #94a3b8;
    transition: color .2s;
    text-align: center;
}

.nde-progress-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    transition: all .2s;
}

.nde-progress-step.is-active {
    color: #1B3A5C;
    font-weight: 600;
}
.nde-progress-step.is-active .nde-progress-step-num {
    background: #1B3A5C;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(27,58,92,.15);
}

.nde-progress-step.is-done {
    color: #2C8C7B;
}
.nde-progress-step.is-done .nde-progress-step-num {
    background: #2C8C7B;
    color: #fff;
}
.nde-progress-step.is-done .nde-progress-step-num::before {
    content: '✓';
    font-size: 13px;
}
.nde-progress-step.is-done .nde-progress-step-num span,
.nde-progress-step.is-done .nde-progress-step-num {
    /* Sayıyı gizle, tick işareti göster */
    font-size: 0;
}
.nde-progress-step.is-done .nde-progress-step-num::before {
    font-size: 13px;
}

.nde-progress-summary {
    font-size: 12px;
    color: #6b7280;
    text-align: right;
}
.nde-progress-current {
    color: #1B3A5C;
    font-weight: 700;
}

/* Mobil: progress kompakt */
@media (max-width: 600px) {
    .nde-progress {
        padding: 10px 14px 8px;
        margin: 0 -14px 16px;
    }
    .nde-progress-step-label {
        display: none; /* Mobilde sadece numara/tick */
    }
    .nde-progress-step-num {
        width: 26px;
        height: 26px;
    }
}

/* Alan-bazlı hatalı input görsel feedback */
.nde-step input[aria-invalid="true"],
.nde-step select[aria-invalid="true"],
.nde-step textarea[aria-invalid="true"] {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important;
}

/* Hata mesajı kutusu — eskiden setTimeout ile fade out olabiliyordu;
 * submit hataları kalıcı görünmeli */
.nde-error {
    color: #dc2626;
    font-size: .8rem;
    margin-top: .35rem;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
 * #1.6.0: ZENGİN BAŞARI EKRANI
 * ═══════════════════════════════════════════════════════════════ */
.nde-success-screen {
    text-align: center;
    padding: 32px 20px;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 60%);
    border-radius: 12px;
}
.nde-success-screen-icon {
    color: #16a34a;
    margin-bottom: 12px;
    animation: nde-success-pop .5s ease-out;
}
@keyframes nde-success-pop {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.nde-success-screen-title {
    font-size: 1.4rem;
    color: #15803d;
    margin: 0 0 6px;
}
.nde-success-screen-subtitle {
    font-size: .9rem;
    color: #4b5563;
    margin: 0 0 22px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
.nde-success-screen-no {
    background: #fff;
    border: 2px dashed #16a34a;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 0 auto 24px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.nde-success-screen-no-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    font-weight: 600;
}
.nde-success-screen-no-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #15803d;
    font-family: 'SF Mono', Menlo, monospace;
    letter-spacing: 1px;
}
.nde-success-screen-copy {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .75rem;
    font-weight: 600;
    transition: background .15s;
}
.nde-success-screen-copy:hover {
    background: #dcfce7;
}
.nde-success-screen-copy.is-copied {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.nde-success-screen-section {
    text-align: left;
    max-width: 480px;
    margin: 0 auto 22px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}
.nde-success-screen-section h4 {
    margin: 0 0 10px;
    font-size: .9rem;
    color: #1B3A5C;
    font-weight: 700;
}
.nde-success-screen-list {
    margin: 0;
    padding-left: 22px;
    font-size: .85rem;
    color: #374151;
    line-height: 1.6;
}
.nde-success-screen-list li {
    margin-bottom: 8px;
}
.nde-success-screen-list strong {
    color: #1B3A5C;
    font-family: 'SF Mono', Menlo, monospace;
    font-size: .85em;
}
.nde-success-screen-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.nde-success-screen-footer {
    font-size: .8rem;
    color: #6b7280;
    margin-top: 12px;
}
.nde-success-screen-footer a {
    color: #1B3A5C;
    font-weight: 600;
}
@media (max-width: 600px) {
    .nde-success-screen {
        padding: 24px 14px;
    }
    .nde-success-screen-actions .nde-btn {
        width: 100%;
    }
}

/* #1.10.0 — Kurs tanıtım sekmeleri (başvuru formu üstü) */
.nde-kurs-tanitim {
    margin: 1rem 0 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.nde-kurs-tanitim__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.nde-kurs-tanitim__tab {
    flex: 1 1 auto;
    min-width: 120px;
    padding: .7rem 1rem;
    border: none;
    background: transparent;
    font-size: .9rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
}
.nde-kurs-tanitim__tab:hover {
    color: #1e3a5f;
    background: #eef2f7;
}
.nde-kurs-tanitim__tab.is-active {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
    background: #fff;
}
.nde-kurs-tanitim__panel {
    padding: 1.1rem 1.25rem;
    font-size: .92rem;
    line-height: 1.6;
    color: #334155;
}
.nde-kurs-tanitim__panel.is-active { display: block; }
.nde-kurs-tanitim__panel p:first-child { margin-top: 0; }
.nde-kurs-tanitim__panel p:last-child { margin-bottom: 0; }
.nde-kurs-tanitim__panel ul,
.nde-kurs-tanitim__panel ol { padding-left: 1.3rem; margin: .5rem 0; }
.nde-kurs-tanitim__panel a { color: #1e3a5f; text-decoration: underline; }
