/* ═══════════════════════════════════════════════════════════
   KOÇOĞLU MÜCEVHERAT – Müşteri Bilgi Formu
   Mobil-önce, responsive tasarım
═══════════════════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --gold:       #C9A84C;
    --gold-dark:  #9E7B2F;
    --gold-light: #F0D68A;
    --gold-pale:  #FDF8EC;
    --dark:       #1A1A2E;
    --dark-2:     #16213E;
    --text:       #2D2D2D;
    --text-muted: #6B6B6B;
    --border:     #E0D5B8;
    --success:    #2E7D32;
    --error:      #C62828;
    --white:      #FFFFFF;
    --bg:         #F9F7F1;
    --radius:     12px;
    --shadow:     0 2px 16px rgba(0,0,0,0.10);
    --shadow-lg:  0 8px 32px rgba(0,0,0,0.18);
    --transition: 0.22s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.app-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-inner { max-width: 640px; margin: 0 auto; }

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px rgba(201,168,76,0.6));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.company-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.company-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.3px;
}

/* ── STEPS BAR ── */
.steps-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    gap: 0;
    position: sticky;
    top: 65px;
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E8E0CC;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.step.active .step-circle {
    background: var(--gold);
    color: var(--white);
    border-color: var(--gold-dark);
    box-shadow: 0 0 0 4px rgba(201,168,76,0.2);
}

.step.done .step-circle {
    background: var(--success);
    color: var(--white);
}

.step.done .step-circle::before { content: '✓'; font-size: 14px; }
.step.done .step-circle span { display: none; }

.step span {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.step.active span { color: var(--gold-dark); font-weight: 600; }

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 6px;
    margin-bottom: 18px;
    max-width: 80px;
    transition: var(--transition);
}

/* ── SECTIONS ── */
.page-section {
    display: none;
    animation: fadeSlide 0.3s ease;
}

.page-section.active { display: block; }

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

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

/* ── SECTION HEADER ── */
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .icon { font-size: 22px; }

.section-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-front { background: var(--gold); color: var(--dark); }
.badge-back  { background: var(--dark); color: var(--gold-light); }

/* ── ID CARD SECTION ── */
.id-card-section {
    margin-bottom: 20px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.id-card-label {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    background: var(--gold-pale);
}

/* ── UPLOAD ZONE ── */
.upload-zone {
    position: relative;
    min-height: 160px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #FAFAFA;
    transition: background var(--transition);
}

.upload-zone:hover { background: #F5F0E0; }
.upload-zone.drag-over { background: #F0E8C8; border: 2px dashed var(--gold); }

.upload-placeholder {
    text-align: center;
    padding: 24px;
}

.upload-icon { font-size: 40px; margin-bottom: 8px; }
.upload-placeholder p  { font-size: 15px; font-weight: 500; color: var(--text); }
.upload-placeholder small { font-size: 12px; color: var(--text-muted); }

.id-preview {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
}

.file-input-hidden { display: none; }

/* OCR overlay */
.ocr-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26,26,46,0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
}

.ocr-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--gold-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* OCR results */
.ocr-result {
    padding: 0 16px 12px;
}

.ocr-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #E8F5E9;
    border: 1px solid #A5D6A7;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    margin: 4px 4px 4px 0;
    color: var(--success);
}

/* ── OCR STATUS BOX ── */
.ocr-status-box {
    background: linear-gradient(135deg, #E8F5E9, #F1F8E9);
    border: 1px solid #A5D6A7;
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.ocr-status-icon { font-size: 28px; }
.ocr-status-text { display: flex; flex-direction: column; gap: 2px; }
.ocr-status-text strong { font-size: 14px; color: var(--success); }
.ocr-status-text span   { font-size: 13px; color: var(--text-muted); }

/* ── FORM ── */
.form-group-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 18px 0 8px;
    border-bottom: 2px solid var(--gold-light);
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
    flex: 1;
}

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

.form-row .form-group { margin-bottom: 16px; }

@media (max-width: 480px) {
    .form-row { flex-direction: column; gap: 0; }
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.req { color: var(--error); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.18);
}

input.error,
textarea.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(198,40,40,0.12);
}

input.filled { border-color: #81C784; background: #F9FFF9; }

.field-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

textarea { resize: vertical; min-height: 80px; }

/* ── RADIO GROUP ── */
.radio-group { display: flex; gap: 16px; margin-top: 6px; }

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
    background: var(--white);
    flex: 1;
    justify-content: center;
}

.radio-label:has(input:checked) {
    border-color: var(--gold);
    background: var(--gold-pale);
    color: var(--gold-dark);
}

.radio-label input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.radio-custom {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    transition: var(--transition);
    position: relative;
}

.radio-label:has(input:checked) .radio-custom {
    border-color: var(--gold-dark);
    background: var(--gold);
}

/* ── TC VALIDATE ── */
#tcValidate { font-size: 12px; }
#tcValidate.valid   { color: var(--success); }
#tcValidate.invalid { color: var(--error); }

/* ── BUTTONS ── */
.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
    box-shadow: 0 4px 14px rgba(158,123,47,0.35);
    flex: 1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-dark), #7A5E20);
    box-shadow: 0 6px 20px rgba(158,123,47,0.45);
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover { background: #F5F0E0; }

.btn-success {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(46,125,50,0.35);
}

.btn-success:hover { box-shadow: 0 6px 20px rgba(46,125,50,0.45); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    padding: 10px 20px;
    text-decoration: underline;
}

.btn-full { width: 100%; flex: unset; }

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ── SIGNATURE ── */
.signature-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.signature-label {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gold-pale);
    font-size: 14px;
    font-weight: 600;
}

.btn-clear-sig {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-clear-sig:hover { background: #FFE0E0; border-color: #EF9A9A; color: var(--error); }

.signature-wrapper {
    position: relative;
    background: #FEFDF8;
    min-height: 180px;
}

#signatureCanvas {
    display: block;
    width: 100%;
    touch-action: none;
    cursor: crosshair;
}

.sig-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #BDBDBD;
    pointer-events: none;
    font-style: italic;
}

.sig-hint {
    padding: 8px 16px 12px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* ── SUMMARY BOX ── */
.summary-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.summary-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 400px) { .summary-grid { grid-template-columns: 1fr; } }

.summary-item { display: flex; flex-direction: column; gap: 1px; }
.summary-key  { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.summary-val  { font-size: 13px; color: var(--text); font-weight: 500; word-break: break-word; }

/* ── ID PHOTOS PREVIEW ── */
.id-photos-preview {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.id-photos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

.id-photo-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    min-height: 100px;
    background: #FAFAFA;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.id-photo-item .badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 1;
    font-size: 9px;
}

.id-photo-item img {
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    display: block;
}

.no-photo {
    font-size: 12px;
    color: #BDBDBD;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    width: 100%;
    font-style: italic;
}

/* ── LEGAL BOX ── */
.legal-box {
    background: #FFF8E1;
    border: 1px solid #FFD54F;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.legal-box p {
    font-size: 11px;
    color: #5D4037;
    line-height: 1.6;
}

/* ── CHECKBOX ── */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] { display: none; }

.checkbox-custom {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid var(--border);
    flex-shrink: 0;
    margin-top: 1px;
    transition: var(--transition);
    position: relative;
    background: var(--white);
}

.checkbox-label:has(input:checked) .checkbox-custom {
    background: var(--gold);
    border-color: var(--gold-dark);
}

.checkbox-label:has(input:checked) .checkbox-custom::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--white);
    font-weight: 700;
}

/* ── PDF LOADING ── */
.pdf-loading {
    position: fixed;
    inset: 0;
    background: rgba(26,26,46,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 999;
}

.pdf-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(201,168,76,0.3);
    border-top-color: var(--gold-light);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.pdf-loading p {
    color: var(--white);
    font-size: 16px;
    font-weight: 500;
}

/* ── TOAST ── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: opacity 0.3s;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
}

.toast.error  { background: var(--error); }
.toast.success { background: var(--success); }

/* ── HIDDEN UTILITY ── */
.hidden { display: none !important; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gold-light); border-radius: 3px; }

/* ── UPLOAD BUTON SATIRI (Galeri / Kamera) ── */
.upload-btn-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px;
    background: var(--white);
}

.btn-upload-opt {
    flex: 1;
    padding: 11px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition);
}

.btn-upload-opt:hover {
    background: var(--gold-pale);
    border-color: var(--gold);
    color: var(--gold-dark);
}

.btn-upload-opt.btn-camera {
    background: var(--dark);
    color: var(--gold-light);
    border-color: var(--dark);
}

.btn-upload-opt.btn-camera:hover {
    background: #2D3561;
    border-color: #2D3561;
}

/* ── ISLAK İMZA BİLGİLENDİRME KUTUSU ── */
.wet-signature-notice {
    background: linear-gradient(135deg, #E3F2FD, #EDE7F6);
    border: 1.5px solid #90CAF9;
    border-left: 5px solid #1976D2;
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.wet-sig-icon {
    font-size: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}

.wet-sig-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wet-sig-text strong {
    font-size: 14px;
    color: #0D47A1;
}

.wet-sig-text span {
    font-size: 12.5px;
    color: #1565C0;
    line-height: 1.5;
}

/* Adım 3'te imza canvas artık yok — eski imza kurallarını gizle */
.signature-section { display: none; }
