/* ═══════════════════════════════════════════════════════════════
   FORMS — Yazılı mülakat formu (/kariyer/)
   tokens.css değişkenleri üzerine kurulu; başka sayfada kullanılmıyor.
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────── Sayfa başlığı ─────────────── */

/* Üst boşluk = sabit navbar + sabit ilerleme çubuğu + nefes payı */
.career-page-header {
    padding: calc(var(--nav-height) + 44px + clamp(1.5rem, 6vw, 4rem)) clamp(1rem, 4vw, 3rem) clamp(2rem, 4vw, 3rem);
    text-align: center;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
    border-bottom: 1px solid rgba(12, 74, 110, 0.08);
}

.career-page-header h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    margin: 0 0 var(--space-md);
    line-height: 1.15;
}

.career-page-lead {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    color: var(--gray-600);
    max-width: 62ch;
    margin: 0 auto;
}

.career-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs) var(--space-md);
    margin-top: var(--space-lg);
}

.career-meta span {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy-700);
    background: var(--navy-50);
    border: 1px solid var(--navy-100);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
}

/* ─────────────── İlerleme çubuğu ─────────────── */

/* body/html'de overflow-x: hidden olduğu için position: sticky çalışmaz — fixed kullanılıyor,
   .interview-section padding-top'u bu çubuğun yüksekliğini telafi eder. */
.form-progress {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.form-progress-bar {
    height: 3px;
    background: var(--gray-200);
}

.form-progress-fill {
    height: 100%;
    width: 0;
    background: var(--navy-700);
    transition: width var(--transition-smooth);
}

.form-progress-text {
    display: block;
    max-width: 820px;
    margin: 0 auto;
    padding: 8px clamp(1rem, 4vw, 2rem);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--gray-600);
}

/* ─────────────── Form gövdesi ─────────────── */

.interview-section {
    padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) clamp(4rem, 8vw, 6rem);
    scroll-margin-top: calc(var(--nav-height) + 44px);
}

/* Hata/odak scroll'unda alan başlıkları nav + ilerleme çubuğunun altında kalmasın */
.form-field,
.form-choice,
.form-consent,
.form-error-summary,
.form-success {
    scroll-margin-top: calc(var(--nav-height) + 60px);
}

.interview-form {
    max-width: 820px;
    margin: 0 auto;
}

/* Taslak geri yükleme bildirimi */
.form-draft-notice {
    display: none;
    align-items: flex-start;
    gap: var(--space-sm);
    background: var(--navy-50);
    border: 1px solid var(--navy-100);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-lg);
    font-size: var(--text-sm);
    color: var(--navy-800);
}

.form-draft-notice.is-visible { display: flex; }

.form-draft-notice button {
    margin-left: auto;
    flex-shrink: 0;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--red-700);
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 2px 4px;
}

/* Bölümler */
.form-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: var(--space-lg);
}

.form-section-title {
    display: block;
    width: 100%;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-strong);
    padding: 0 0 var(--space-md);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-soft);
}

.form-section-title span {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--navy-600);
    margin-bottom: var(--space-2xs);
}

/* Alanlar */
.form-field {
    margin-bottom: var(--space-lg);
}

.form-field:last-child { margin-bottom: 0; }

.form-grid {
    display: grid;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .form-field { margin-bottom: 0; }
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-800);
    line-height: var(--leading-snug);
    margin-bottom: var(--space-xs);
}

.form-num {
    color: var(--navy-600);
    font-weight: 700;
    margin-right: 6px;
}

.form-required {
    color: var(--red-600);
    margin-left: 2px;
}

.form-hint {
    display: block;
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--text-muted);
    margin-top: var(--space-2xs);
}

.form-input,
.form-textarea {
    display: block;
    width: 100%;
    font: inherit;
    font-size: var(--text-base);
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.form-textarea {
    min-height: 96px;
    resize: vertical;
    line-height: var(--leading-normal);
    overflow: hidden;
}

.form-textarea--long { min-height: 150px; }

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-400);
}

.form-input:hover,
.form-textarea:hover { border-color: var(--gray-400); }

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.14);
}

.form-input:focus-visible,
.form-textarea:focus-visible {
    outline: 2px solid var(--navy-600);
    outline-offset: 1px;
}

/* Hata durumu */
.form-field.has-error .form-input,
.form-field.has-error .form-textarea {
    border-color: var(--red-600);
    background: #fffafa;
}

.form-field.has-error .form-input:focus,
.form-field.has-error .form-textarea:focus {
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.14);
}

.field-error {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--red-700);
    margin-top: var(--space-2xs);
}

.form-field.has-error .field-error { display: flex; }

.field-error::before {
    content: '';
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--red-600);
    -webkit-mask: no-repeat center / 10px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-2h2zm0-4h-2V7h2z'/%3E%3C/svg%3E");
    mask: no-repeat center / 10px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-2h2zm0-4h-2V7h2z'/%3E%3C/svg%3E");
    background-color: var(--red-600);
}

/* Karakter sayacı */
.form-counter {
    display: block;
    text-align: right;
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}

.form-counter.is-visible { opacity: 1; }
.form-counter.is-near { color: var(--warm-700); }
.form-counter.is-over { color: var(--red-700); font-weight: 700; }

/* E-posta yazım önerisi */
.form-suggest {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: var(--text-xs);
    color: var(--gray-600);
    margin-top: var(--space-2xs);
}

.form-suggest.is-visible { display: flex; }

.form-suggest button {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--navy-700);
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 2px 4px;
}

/* ─────────────── Radio grupları ─────────────── */

.form-choice {
    border: none;
    padding: 0;
    margin: 0 0 var(--space-lg);
    min-width: 0;
}

.form-choice:last-child { margin-bottom: 0; }

.form-choice > legend {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-800);
    line-height: var(--leading-snug);
    margin-bottom: var(--space-xs);
    padding: 0;
}

.form-radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

@media (min-width: 640px) {
    .form-radio-group--inline {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .form-radio-group--inline .form-radio { flex: 0 1 auto; }
}

.form-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 16px 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: var(--text-sm);
    color: var(--gray-700);
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.form-radio:hover { border-color: var(--navy-600); background: var(--navy-50); }

.form-radio input[type="radio"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid var(--gray-400);
    border-radius: 50%;
    background: var(--white);
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-radio input[type="radio"]:checked {
    border-color: var(--navy-800);
    box-shadow: inset 0 0 0 4px var(--navy-800);
}

.form-radio:has(input:checked) {
    border-color: var(--navy-800);
    background: var(--navy-50);
    color: var(--navy-900);
    font-weight: 600;
}

.form-radio input[type="radio"]:focus-visible {
    outline: 2px solid var(--navy-600);
    outline-offset: 3px;
}

/* Uzun seçenek metni (senaryo A/B) */
.form-radio--block {
    align-items: flex-start;
    line-height: var(--leading-normal);
}

.form-radio--block input[type="radio"] { margin-top: 2px; }

.form-choice.has-error .form-radio {
    border-color: var(--red-600);
}

.form-choice.has-error .field-error { display: flex; }

/* ─────────────── Senaryo alıntısı ─────────────── */

.form-quote {
    border-left: 3px solid var(--navy-700);
    background: var(--gray-50);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: var(--space-sm) var(--space-md);
    margin: 0 0 var(--space-sm);
    font-style: italic;
    color: var(--gray-700);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

/* ─────────────── KVKK onayı ─────────────── */

.form-consent {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    padding: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: var(--space-lg);
}

.form-consent-text {
    font-size: var(--text-sm);
    color: var(--gray-600);
    line-height: var(--leading-normal);
    margin-bottom: var(--space-md);
}

.form-consent-text a { color: var(--navy-700); text-decoration: underline; text-underline-offset: 3px; }

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--gray-800);
    line-height: var(--leading-normal);
}

.form-check input[type="checkbox"] {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid var(--gray-400);
    border-radius: 5px;
    background: var(--white);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.form-check input[type="checkbox"]:checked {
    background: var(--navy-800) no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    border-color: var(--navy-800);
}

.form-check input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--navy-600);
    outline-offset: 3px;
}

.form-consent.has-error .form-check input[type="checkbox"] { border-color: var(--red-600); }
.form-consent.has-error .field-error { display: flex; margin-top: var(--space-xs); }

/* ─────────────── Hata özeti & durum ─────────────── */

.form-error-summary {
    display: none;
    border: 1px solid var(--red-600);
    border-left-width: 4px;
    background: var(--red-100);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    color: var(--red-700);
    font-size: var(--text-sm);
}

.form-error-summary.is-visible { display: block; }

.form-error-summary strong { display: block; margin-bottom: var(--space-2xs); }

.form-error-summary ul { margin: var(--space-xs) 0 0; padding: 0; }

.form-error-summary li { margin-bottom: 4px; }

.form-error-summary a {
    color: var(--red-700);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.form-status {
    display: none;
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.form-status.is-visible { display: block; }

.form-status.is-error {
    background: var(--red-100);
    border: 1px solid var(--red-600);
    color: var(--red-700);
}

.form-status.is-info {
    background: var(--navy-50);
    border: 1px solid var(--navy-100);
    color: var(--navy-800);
}

/* ─────────────── Gönder ─────────────── */

.form-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    text-align: center;
}

.form-actions .btn {
    width: 100%;
    max-width: 340px;
    padding: 16px 28px;
    font-size: var(--text-base);
}

.form-actions .btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.form-actions-note {
    font-size: var(--text-xs);
    color: var(--text-muted);
    max-width: 46ch;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: form-spin 0.7s linear infinite;
}

@keyframes form-spin { to { transform: rotate(360deg); } }

/* ─────────────── Başarı ekranı ─────────────── */

.form-success {
    display: none;
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 4vw, 2.5rem);
}

.form-success.is-visible { display: block; }

/* Programatik odak (fare ile gönderimde) çerçeve göstermesin; klavyede :focus-visible korunur */
.form-success:focus:not(:focus-visible) { outline: none; }

.form-success-mark {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    border-radius: 50%;
    background: var(--navy-800) no-repeat center / 30px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.form-success h2 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-sm);
}

.form-success p {
    color: var(--gray-600);
    margin-bottom: var(--space-lg);
}

.form-ref {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--navy-800);
    background: var(--navy-50);
    border: 1px dashed var(--navy-500);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    margin-bottom: var(--space-lg);
}

.form-ref-label {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--navy-600);
    margin-bottom: 6px;
}

/* ─────────────── Erişilebilirlik / hareket ─────────────── */

@media (prefers-reduced-motion: reduce) {
    .form-progress-fill,
    .form-input,
    .form-textarea,
    .form-radio,
    .form-check input[type="checkbox"] {
        transition: none;
    }
    .btn-spinner { animation-duration: 2s; }
}
