/* ═══════════════════════════════════════════════════════
   TUMEDAB Emlak Sözleşmeleri — Ana Stil Dosyası v2.0
   ═══════════════════════════════════════════════════════ */

:root {
  --t-primary:     #1a3d6e;
  --t-primary-dk:  #112950;
  --t-accent:      #c8870a;
  --t-accent-lt:   #f5a623;
  --t-bg:          #f4f6fb;
  --t-white:       #ffffff;
  --t-border:      #dde3ef;
  --t-text:        #1c2637;
  --t-text-muted:  #6b7a99;
  --t-success:     #2ecc71;
  --t-danger:      #e74c3c;
  --t-radius:      10px;
  --t-shadow:      0 2px 16px rgba(26,61,110,.10);
  --t-shadow-lg:   0 8px 40px rgba(26,61,110,.16);
}

/* RESET */
.tumedab-app * { box-sizing: border-box; margin: 0; padding: 0; }
.tumedab-app { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 15px; color: var(--t-text); background: var(--t-bg); border-radius: var(--t-radius); overflow: hidden; }

/* ── HEADER ── */
.t-header { background: linear-gradient(135deg, var(--t-primary) 0%, #2054a0 100%); color: #fff; padding: 28px 32px; }
.t-header-inner { display: flex; align-items: center; gap: 20px; max-width: 1200px; margin: 0 auto; }
.t-logo { height: 56px; width: auto; object-fit: contain; }
.t-header-text { flex: 1; }
.t-header-text h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.3px; }
.t-header-text p { font-size: .88rem; opacity: .8; margin-top: 3px; }
.t-header-badge span { background: var(--t-accent); color: #fff; font-size: .78rem; font-weight: 700; padding: 6px 14px; border-radius: 20px; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }

/* ── STEP BAR ── */
.t-steps { display: flex; align-items: center; justify-content: center; gap: 0; background: var(--t-white); border-bottom: 1px solid var(--t-border); padding: 18px 24px; }
.t-step { display: flex; align-items: center; gap: 9px; color: var(--t-text-muted); font-size: .85rem; font-weight: 500; transition: color .3s; }
.t-step--active { color: var(--t-primary); }
.t-step--done { color: var(--t-success); }
.t-step-bubble { width: 32px; height: 32px; border-radius: 50%; background: var(--t-border); color: var(--t-text-muted); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; transition: all .3s; flex-shrink: 0; }
.t-step--active .t-step-bubble { background: var(--t-primary); color: #fff; }
.t-step--done .t-step-bubble { background: var(--t-success); color: #fff; }
.t-step-connector { flex: 1; max-width: 80px; height: 2px; background: var(--t-border); margin: 0 12px; }

/* ── PAGES ── */
.t-page { padding: 32px; max-width: 1100px; margin: 0 auto; }
.t-hidden { display: none !important; }

/* ── SECTION TITLE ── */
.t-section-title { text-align: center; margin-bottom: 24px; }
.t-section-title h2 { font-size: 1.4rem; font-weight: 700; color: var(--t-primary); }
.t-section-title p  { color: var(--t-text-muted); font-size: .92rem; margin-top: 6px; }

/* ── SEARCH ── */
.t-search-bar { max-width: 480px; margin: 0 auto 28px; }
.t-search-bar input { width: 100%; padding: 12px 18px; border: 2px solid var(--t-border); border-radius: 40px; font-size: .95rem; outline: none; transition: border-color .2s; }
.t-search-bar input:focus { border-color: var(--t-primary); }

/* ── CARD GRID ── */
.t-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.t-card { background: var(--t-white); border: 2px solid var(--t-border); border-radius: var(--t-radius); padding: 20px 22px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: all .22s ease; position: relative; overflow: hidden; }
.t-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background: var(--t-primary); transform: scaleY(0); transition: transform .22s; transform-origin: center; }
.t-card:hover { border-color: var(--t-primary); box-shadow: var(--t-shadow-lg); transform: translateY(-2px); }
.t-card:hover::before { transform: scaleY(1); }
.t-card-icon { font-size: 2rem; flex-shrink: 0; }
.t-card-body { flex: 1; }
.t-card-body h3 { font-size: .92rem; font-weight: 600; color: var(--t-text); line-height: 1.4; }
.t-card-arrow { color: var(--t-primary); font-size: 1.3rem; opacity: 0; transform: translateX(-6px); transition: all .22s; }
.t-card:hover .t-card-arrow { opacity: 1; transform: translateX(0); }

/* ── FORM HEADER ── */
.t-form-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 2px solid var(--t-border); }
.t-back-btn { background: none; border: 2px solid var(--t-border); color: var(--t-text-muted); padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: .88rem; transition: all .2s; }
.t-back-btn:hover { border-color: var(--t-primary); color: var(--t-primary); }
.t-form-title-area { display: flex; align-items: center; gap: 12px; }
.t-form-icon { font-size: 1.8rem; }
.t-form-title-area h2 { font-size: 1.25rem; font-weight: 700; color: var(--t-primary); }

/* ── FORM SECTIONS ── */
.t-form-section { background: var(--t-white); border: 1px solid var(--t-border); border-radius: var(--t-radius); padding: 24px; margin-bottom: 20px; }
.t-form-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--t-border); }
.t-fsec-icon { font-size: 1.3rem; }
.t-form-section-header h3 { font-size: 1rem; font-weight: 700; color: var(--t-primary); }

/* ── ROWS & FIELDS ── */
.t-row { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.t-row:last-child { margin-bottom: 0; }
.t-row-2 .t-field { flex: 1; min-width: 200px; }
.t-row-3 .t-field { flex: 1; min-width: 160px; }
.t-field { display: flex; flex-direction: column; gap: 6px; }
.t-field.t-full { flex: 1 1 100%; }
.t-field.t-field--wide { flex: 2; min-width: 220px; }

.t-field label { font-size: .82rem; font-weight: 600; color: var(--t-text-muted); text-transform: uppercase; letter-spacing: .4px; }
.t-field label .req { color: var(--t-danger); }

.t-field input,
.t-field select,
.t-field textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--t-border);
  border-radius: 8px;
  font-size: .93rem;
  color: var(--t-text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  font-family: inherit;
}
.t-field input:focus,
.t-field select:focus,
.t-field textarea:focus {
  outline: none;
  border-color: var(--t-primary);
  box-shadow: 0 0 0 3px rgba(26,61,110,.08);
}
.t-field input[readonly] { background: #f7f9fc; color: var(--t-text-muted); }
.t-field textarea { resize: vertical; min-height: 70px; }

/* Input group (bedel + para birimi) */
.t-input-group { display: flex; }
.t-input-group input { border-radius: 8px 0 0 8px; flex: 1; }
.t-input-group select { border-radius: 0 8px 8px 0; border-left: none; width: auto; min-width: 65px; background: var(--t-bg); }

/* ── BUTTONS ── */
.t-btn { padding: 11px 22px; border-radius: 9px; font-size: .9rem; font-weight: 600; cursor: pointer; transition: all .2s; border: none; display: inline-flex; align-items: center; gap: 6px; }
.t-btn-primary   { background: var(--t-primary); color: #fff; }
.t-btn-primary:hover { background: var(--t-primary-dk); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,61,110,.3); }
.t-btn-secondary { background: #fff; color: var(--t-text-muted); border: 2px solid var(--t-border); }
.t-btn-secondary:hover { border-color: var(--t-primary); color: var(--t-primary); }
.t-btn-preview   { background: #fff3e0; color: var(--t-accent); border: 2px solid var(--t-accent-lt); }
.t-btn-preview:hover { background: var(--t-accent-lt); color: #fff; }
.t-btn-print     { background: #e8f5e9; color: #2e7d32; border: 2px solid #a5d6a7; }
.t-btn-print:hover { background: #2e7d32; color: #fff; }

.t-form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* ── ADD ROW BUTTON ── */
.t-add-row-btn { background: none; border: 2px dashed var(--t-border); color: var(--t-primary); padding: 9px 18px; border-radius: 8px; cursor: pointer; font-size: .88rem; font-weight: 600; margin-top: 10px; transition: all .2s; }
.t-add-row-btn:hover { border-color: var(--t-primary); background: rgba(26,61,110,.04); }

.t-gosterilen-row { display: flex; gap: 10px; margin-bottom: 8px; }
.t-gosterilen-row input { flex: 1; padding: 9px 12px; border: 1.5px solid var(--t-border); border-radius: 8px; font-size: .9rem; }

/* ── PREVIEW ── */
.t-preview-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.t-preview-actions { display: flex; gap: 10px; }

.t-preview-content {
  background: #fff;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius);
  padding: 48px 52px;
  box-shadow: var(--t-shadow);
  max-width: 860px;
  margin: 0 auto;
}

/* Preview doc styles */
.tp-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px double var(--t-primary); padding-bottom: 20px; margin-bottom: 28px; }
.tp-logo-area { display: flex; align-items: center; gap: 14px; }
.tp-logo { height: 50px; }
.tp-ofis-bilgi h2 { font-size: 1.05rem; color: var(--t-primary); font-weight: 800; }
.tp-ofis-bilgi p  { font-size: .78rem; color: var(--t-text-muted); }
.tp-soz-no { text-align: right; }
.tp-soz-no .tp-no-label { font-size: .72rem; text-transform: uppercase; color: var(--t-text-muted); }
.tp-soz-no .tp-no-val   { font-size: 1rem; font-weight: 700; color: var(--t-primary); }
.tp-soz-no .tp-tarih    { font-size: .8rem; color: var(--t-text-muted); margin-top: 4px; }

.tp-title { text-align: center; margin: 28px 0; }
.tp-title h1 { font-size: 1.3rem; font-weight: 800; color: var(--t-primary); text-transform: uppercase; letter-spacing: 1px; border-top: 2px solid var(--t-accent); border-bottom: 2px solid var(--t-accent); padding: 14px 0; display: inline-block; }

.tp-taraflar { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.tp-taraf-box { border: 1px solid var(--t-border); border-radius: 8px; padding: 16px; }
.tp-taraf-box h4 { font-size: .78rem; text-transform: uppercase; color: var(--t-primary); font-weight: 700; margin-bottom: 10px; border-bottom: 1px solid var(--t-border); padding-bottom: 6px; }
.tp-row { display: flex; justify-content: space-between; font-size: .85rem; padding: 4px 0; border-bottom: 1px dashed #eee; }
.tp-row:last-child { border-bottom: none; }
.tp-row span:first-child { color: var(--t-text-muted); flex: 1; }
.tp-row span:last-child  { font-weight: 500; flex: 2; text-align: right; }

.tp-section { margin-bottom: 24px; }
.tp-section-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; color: var(--t-accent); letter-spacing: .8px; margin-bottom: 10px; }
.tp-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tp-table th { background: var(--t-primary); color: #fff; padding: 9px 12px; text-align: left; font-weight: 600; font-size: .8rem; }
.tp-table td { padding: 9px 12px; border-bottom: 1px solid var(--t-border); }
.tp-table tr:nth-child(even) td { background: #f8faff; }

.tp-madde { margin-bottom: 10px; font-size: .88rem; line-height: 1.7; }
.tp-madde strong { color: var(--t-primary); }

.tp-imzalar { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; }
.tp-imza-box { border-top: 1.5px solid var(--t-text); padding-top: 10px; text-align: center; }
.tp-imza-box p { font-size: .82rem; color: var(--t-text-muted); }
.tp-imza-box strong { font-size: .9rem; display: block; margin-top: 4px; }
.tp-imza-box .tp-imza-bos { height: 60px; }

/* ── SUCCESS ── */
.t-success-box { text-align: center; padding: 60px 32px; background: #fff; border-radius: var(--t-radius); border: 1px solid var(--t-border); box-shadow: var(--t-shadow); }
.t-success-icon { font-size: 4rem; margin-bottom: 16px; }
.t-success-box h2 { font-size: 1.6rem; color: var(--t-success); margin-bottom: 10px; }
.t-success-box p  { color: var(--t-text-muted); font-size: 1rem; }
.t-success-actions { display: flex; justify-content: center; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

/* ── TOAST ── */
.t-toast { position: fixed; bottom: 28px; right: 28px; background: var(--t-primary); color: #fff; padding: 14px 24px; border-radius: 10px; font-size: .9rem; box-shadow: var(--t-shadow-lg); z-index: 99999; transition: opacity .3s; }
.t-toast.t-toast-success { background: var(--t-success); }
.t-toast.t-toast-error   { background: var(--t-danger); }

/* ── PRINT ── */
@media print {
  body > *:not(.tumedab-app) { display: none !important; }
  .t-header, .t-steps, #t-page-1, #t-page-2, .t-preview-toolbar, #t-page-success, .t-toast { display: none !important; }
  #t-page-3 { display: block !important; padding: 0 !important; }
  .t-preview-content { box-shadow: none !important; border: none !important; padding: 0 !important; }
  @page { margin: 1.5cm 2cm; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .t-header { padding: 20px 18px; }
  .t-header-inner { flex-wrap: wrap; }
  .t-header-badge { display: none; }
  .t-page { padding: 18px 14px; }
  .t-card-grid { grid-template-columns: 1fr; }
  .t-row-2 .t-field, .t-row-3 .t-field { min-width: 100%; }
  .t-steps { gap: 0; padding: 14px 10px; }
  .t-step span { display: none; }
  .tp-taraflar { grid-template-columns: 1fr; }
  .tp-imzalar { grid-template-columns: 1fr; }
  .t-preview-content { padding: 24px 16px; }
  .tp-header { flex-direction: column; gap: 12px; }
  .tp-soz-no { text-align: left; }
  .t-form-actions { justify-content: stretch; }
  .t-form-actions .t-btn { flex: 1; justify-content: center; }
}

@media (max-width: 480px) {
  .t-header-text h1 { font-size: 1.15rem; }
  .t-section-title h2 { font-size: 1.15rem; }
}
