/* ============================================
   HİPOKRATAMCA — KATKI FORMU
   Tasarım dili: klinik güven + kalp atışı imzası
   ============================================ */

:root {
  /* Renkler */
  --bg: #F3FAFA;
  --bg-alt: #E7F3F2;
  --surface: #FFFFFF;
  --ink: #16323A;
  --ink-soft: #58767D;
  --ink-faint: #93A9AD;
  --primary: #0E6B63;
  --primary-dark: #094B45;
  --primary-soft: #E3F3F1;
  --accent: #FF6B57;
  --accent-soft: #FFE9E5;
  --success: #1F9D74;
  --success-soft: #E4F6EE;
  --border: #DCE9E8;
  --border-strong: #C3D9D7;
  --shadow-sm: 0 2px 8px rgba(14, 60, 55, 0.06);
  --shadow-md: 0 12px 32px rgba(14, 60, 55, 0.10);
  --shadow-lg: 0 24px 60px rgba(14, 60, 55, 0.16);

  /* Tipografi */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, var(--bg-alt) 0%, transparent 45%),
    radial-gradient(circle at 88% 92%, var(--bg-alt) 0%, transparent 40%);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 24px 40px;
}

/* ---------- HEADER ---------- */

.site-header {
  text-align: center;
  margin-bottom: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-mark { width: 34px; height: 34px; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--primary-dark);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 500;
}

.site-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: var(--ink);
}

.lead {
  max-width: 520px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* Signature ECG divider */
.ecg-divider {
  width: 100%;
  height: 46px;
  margin-top: 32px;
  overflow: visible;
}

.ecg-path {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: ecg-draw 2.6s ease-out forwards, ecg-pulse 3.2s ease-in-out 2.6s infinite;
}

@keyframes ecg-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes ecg-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- FORM STRUCTURE ---------- */

.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 30px 34px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease;
}

.form-section:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.form-section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 22px;
}

.section-icon {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-note {
  margin: -12px 0 20px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}

.field label .opt {
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 0.82rem;
}

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

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field textarea { resize: vertical; min-height: 54px; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.field input:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--accent);
}

/* Honeypot — görsel olarak tamamen gizli */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- DROPZONE ---------- */

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  outline: none;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.01);
}

.upload-icon { width: 40px; height: 40px; margin-bottom: 10px; }

.dropzone-content p { margin: 4px 0; }

.dropzone-content strong { color: var(--ink); }

.browse-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hint {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
  letter-spacing: 0.01em;
}

.file-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
  animation: file-in 0.25s ease;
}

@keyframes file-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.file-list .file-icon {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 6px;
  padding: 3px 6px;
  flex-shrink: 0;
}

.file-list .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.file-list .file-size {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.file-list .file-remove {
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.file-list .file-remove:hover { color: var(--accent); background: var(--accent-soft); }

/* ---------- LINK GROUPS ---------- */

.link-group {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 44px 18px 20px;
  margin-bottom: 14px;
  background: var(--bg);
}

.link-group .field { margin-bottom: 14px; }
.link-group .field:last-child { margin-bottom: 0; }

.remove-link {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--ink-faint);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.remove-link:hover { color: var(--accent); background: var(--accent-soft); }

.link-group:only-child .remove-link { display: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-secondary:hover { background: #CDEAE6; }
.btn-secondary:active { transform: scale(0.98); }

/* ---------- CONSENT ---------- */

.form-section--consent {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 4px 6px 8px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-row input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* ---------- SUBMIT ---------- */

.submit-row {
  text-align: center;
  margin-top: 8px;
}

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 16px 42px;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(14, 107, 99, 0.32);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  min-width: 220px;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(14, 107, 99, 0.38); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.75; cursor: not-allowed; transform: none; }

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.form-error {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 14px;
  font-weight: 600;
}

/* ---------- FOOTER ---------- */

.site-footer {
  text-align: center;
  margin-top: 48px;
  color: var(--ink-faint);
  font-size: 0.84rem;
}

/* ---------- MODAL ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 35, 33, 0.42);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: overlay-in 0.25s ease;
}

/* [hidden] attribute'unun her zaman gizlemesini garantile — aksi halde
   yukarıdaki display:flex tarayıcının varsayılan gizleme kuralını ezer. */
.modal-overlay[hidden] {
  display: none;
}

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 44px 36px 36px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.88) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.success-check { width: 92px; height: 92px; margin: 0 auto 18px; display: block; }

.check-circle {
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: draw-circle 0.6s ease forwards 0.1s;
}

.check-mark {
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
  animation: draw-check 0.4s ease forwards 0.65s;
}

@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

.modal-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 8px;
  color: var(--ink);
}

.modal-card p {
  color: var(--ink-soft);
  margin: 0 0 26px;
  font-size: 0.96rem;
}

.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  border-radius: 2px;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(340px) rotate(540deg);
    opacity: 0;
  }
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 640px) {
  .page { padding: 36px 16px 28px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .form-section { padding: 24px 20px 28px; }
  .btn-primary { width: 100%; }
}

/* ---------- REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
  .ecg-path { animation: none; stroke-dashoffset: 0; }
  html { scroll-behavior: auto; }
  .modal-card, .modal-overlay, .file-list li { animation: none; }
  .check-circle, .check-mark { animation: none; stroke-dashoffset: 0; }
  .confetti-piece { display: none; }
}
