/* ============================================================
   EventLeads - Kayalar Kimya fuar kayit formu
   Mobil oncelikli, dokunmatik dostu tasarim sistemi
   ============================================================ */

:root {
  /* Marka renkleri - kayalarkimya.com.tr logosundan */
  --green:      #499d58;
  --green-600:  #3d8a4a;
  --green-700:  #2f6f3c;
  --green-100:  #dcefe0;
  --green-50:   #eff7f1;

  --ink:        #161615;
  --ink-soft:   #3a3f39;
  --muted:      #6d7470;
  --faint:      #9aa19c;

  --bg:         #f4f7f3;
  --card:       #ffffff;
  --line:       #e2e8e1;
  --line-soft:  #eef2ed;

  --danger:     #c0392b;
  --danger-bg:  #fdeeec;
  --amber:      #b7791f;
  --amber-bg:   #fdf6e7;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(22, 22, 21, .05);
  --shadow-md: 0 4px 16px rgba(22, 22, 21, .07);
  --shadow-lg: 0 12px 40px rgba(22, 22, 21, .10);

  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

/* Ust kismi yumusak marka gradyani */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 340px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(73, 157, 88, .16) 0%, rgba(73, 157, 88, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ---------------------------------------------------------- Layout */

.app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 18px calc(140px + var(--safe-b));
  min-height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 2px 18px;
}
.topbar .logo { height: 34px; width: auto; display: block; }

.event-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
  min-width: 0;
}
.event-chip .ev-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}
.event-chip .ev-loc {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------------------------------------------------------- Progress */

.progress {
  display: flex;
  gap: 6px;
  margin: 0 2px 22px;
}
.progress i {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  transition: background .35s ease;
}
.progress i.done { background: var(--green); }
.progress i.now  { background: linear-gradient(90deg, var(--green) 55%, var(--line) 55%); }

/* ---------------------------------------------------------- Card / steps */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 26px 22px 24px;
  box-shadow: var(--shadow-md);
}

.step { display: none; animation: slide .32s cubic-bezier(.22,.8,.3,1); }
.step.active { display: block; }

@keyframes slide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .step, .step.active { animation: none; }
  * { transition-duration: .01ms !important; }
}

.step-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--green-600);
  margin-bottom: 8px;
}
.step h2 {
  margin: 0 0 6px;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -.024em;
  font-weight: 800;
}
.step .lede {
  margin: 0 0 24px;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------------------------------------------------------- Fields */

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

.field > label,
.field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.field-label .opt {
  font-weight: 500;
  color: var(--faint);
  margin-left: 4px;
}

.input,
input[type="text"], input[type="tel"], input[type="email"],
input[type="password"], input[type="search"], input[type="date"],
select, textarea {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  font-size: 16px;             /* iOS'ta odaklanirken zoom olmamasi icin */
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
  appearance: none;
}
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }

input::placeholder, textarea::placeholder { color: var(--faint); }

input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-50);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--line-soft);
  color: var(--muted);
}
.field.invalid input,
.field.invalid select,
.field.invalid .phone-row {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-bg);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5 7 7.5l6-6' stroke='%236d7470' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.hint  { font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.45; }
.error { font-size: 12.5px; color: var(--danger); margin-top: 7px; font-weight: 600; display: none; }
.field.invalid .error { display: block; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; gap: 0; } }

/* ---------------------------------------------------------- Phone */

.phone-row {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.phone-row:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-50);
}
.phone-row select {
  width: 108px;
  flex: 0 0 108px;
  border: none;
  border-right: 1.5px solid var(--line);
  border-radius: 0;
  background-color: var(--line-soft);
  background-position: right 10px center;
  padding: 14px 28px 14px 13px;
  font-size: 15px;
  font-weight: 650;
  box-shadow: none;
}
.phone-row select:focus { box-shadow: none; }
.phone-row input {
  border: none;
  border-radius: 0;
  flex: 1;
  min-width: 0;
  letter-spacing: .02em;
  box-shadow: none;
}
.phone-row input:focus { box-shadow: none; }

/* ---------------------------------------------------------- OTP */

.otp-wrap { margin: 4px 0 10px; }
.otp-boxes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.otp-boxes input {
  min-height: 62px;
  padding: 0;
  text-align: center;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0;
  border-radius: var(--r-md);
  background: var(--line-soft);
  border-color: transparent;
}
.otp-boxes input:focus {
  background: var(--card);
  border-color: var(--green);
}
.otp-boxes.filled input { border-color: var(--green-100); background: var(--green-50); }
.otp-boxes.shake { animation: shake .4s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.otp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
.linkbtn {
  color: var(--green-600);
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 2px;
  border-radius: 6px;
}
.linkbtn:disabled { color: var(--faint); font-weight: 600; cursor: default; }
.linkbtn:not(:disabled):active { color: var(--green-700); }

.phone-echo {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 14.5px;
  font-weight: 650;
}
.phone-echo .num { flex: 1; letter-spacing: .01em; }
.phone-echo button {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-700);
  text-decoration: underline;
  padding: 4px;
}

/* ---------------------------------------------------------- Chips */

.chips { display: flex; flex-wrap: wrap; gap: 9px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all .16s ease;
  user-select: none;
}
.chip:active { transform: scale(.97); }
.chip.on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 3px 10px rgba(73, 157, 88, .28);
}
.chip .tick {
  width: 15px; height: 15px;
  flex: 0 0 15px;
  opacity: 0;
  transform: scale(.6);
  transition: all .16s ease;
}
.chip.on .tick { opacity: 1; transform: none; }

/* Segmentli secim (kayit alan, sirket buyuklugu) */
.segments { display: grid; gap: 9px; }
.segments.cols-2 { grid-template-columns: 1fr 1fr; }
.seg {
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
  transition: all .16s ease;
}
.seg:active { transform: scale(.985); }
.seg.on {
  border-color: var(--green);
  background: var(--green-50);
  color: var(--green-700);
  box-shadow: inset 0 0 0 1px var(--green);
}

/* ---------------------------------------------------------- Consent */

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
  padding: 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--line-soft);
  transition: all .16s ease;
}
.consent.on { border-color: var(--green); background: var(--green-50); }
.consent.invalid { border-color: var(--danger); background: var(--danger-bg); }

.checkbox {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  margin-top: 1px;
  border: 2px solid var(--faint);
  border-radius: 7px;
  background: var(--card);
  display: grid;
  place-items: center;
  transition: all .16s ease;
}
.checkbox svg { width: 13px; height: 13px; opacity: 0; transform: scale(.5); transition: all .16s ease; }
.consent.on .checkbox { background: var(--green); border-color: var(--green); }
.consent.on .checkbox svg { opacity: 1; transform: none; }

.consent-text { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.consent-text a { color: var(--green-700); font-weight: 650; }

/* ---------------------------------------------------------- Actions */

.actions {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  padding: 14px 18px calc(14px + var(--safe-b));
  background: linear-gradient(180deg, rgba(244,247,243,0) 0%, var(--bg) 34%);
  pointer-events: none;
}
.actions-inner {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.btn {
  flex: 1;
  min-height: 56px;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .12s ease, background .16s ease, opacity .16s ease;
}
.btn:active:not(:disabled) { transform: scale(.98); }

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 18px rgba(73, 157, 88, .30);
}
.btn-primary:active:not(:disabled) { background: var(--green-600); }
.btn-primary:disabled { background: #b9c6bb; box-shadow: none; cursor: default; }

.btn-ghost {
  flex: 0 0 auto;
  min-width: 56px;
  padding: 0 18px;
  background: var(--card);
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}

.btn .spin {
  width: 17px; height: 17px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn.loading .spin { display: block; }
.btn.loading .label { opacity: .75; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- Success */

.done-wrap { text-align: center; padding: 18px 4px 8px; }
.done-mark {
  width: 84px; height: 84px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--green-50);
  display: grid;
  place-items: center;
  animation: pop .45s cubic-bezier(.2,1.4,.4,1);
}
.done-mark svg { width: 40px; height: 40px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

.done-wrap h2 { font-size: 26px; margin: 0 0 8px; letter-spacing: -.025em; }
.done-wrap p  { color: var(--muted); font-size: 15px; margin: 0 0 4px; }

.done-card {
  margin-top: 24px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  background: var(--line-soft);
}
.done-card .row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  font-size: 14px;
}
.done-card .row + .row { border-top: 1px solid var(--line); }
.done-card .k { color: var(--muted); flex: 0 0 auto; }
.done-card .v { font-weight: 650; text-align: right; word-break: break-word; }

/* ---------------------------------------------------------- Banners */

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.banner.warn { background: var(--amber-bg); color: var(--amber); border: 1px solid #f2e2b8; }
.banner.info { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); }
.banner strong { font-weight: 750; }

/* ---------------------------------------------------------- Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--safe-b));
  transform: translate(-50%, 14px);
  z-index: 60;
  max-width: min(440px, calc(100vw - 36px));
  background: var(--ink);
  color: #fff;
  padding: 13px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err  { background: var(--danger); }
.toast.ok   { background: var(--green-700); }

/* ---------------------------------------------------------- Collector badge */

.collector-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.collector-bar button {
  font-weight: 700;
  color: var(--green-700);
  text-decoration: underline;
  padding: 6px 2px;
  font-size: 12.5px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------- Modal */

.modal-back {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(22,22,21,.42);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(2px);
}
.modal-back.show { display: flex; }
.modal {
  background: var(--card);
  width: 100%;
  max-width: 520px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 24px 22px calc(24px + var(--safe-b));
  animation: up .28s cubic-bezier(.22,.9,.3,1);
  max-height: 86dvh;
  overflow-y: auto;
}
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.modal h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; }
.modal p.sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.modal .legal { font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.modal .legal h4 { font-size: 14px; margin: 18px 0 6px; }
