:root {
  --ink: #152033;
  --panel: #ffffff;
  --line: #d5e2ef;
  --text: #152033;
  --muted: #5f738a;
  --signal: #e8941f;
  --signal-2: #0f7ea8;
  --glow: rgba(232, 148, 31, 0.28);
  --danger: #c94444;
  --ok: #1f8f5f;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sky: #e8f4fb;
  --sky-deep: #0f7ea8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: "Figtree", system-ui, sans-serif;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(232, 148, 31, 0.14), transparent 55%),
    radial-gradient(700px 380px at -10% 20%, rgba(15, 126, 168, 0.14), transparent 50%),
    #f3f7fb;
}

a {
  color: var(--signal-2);
  text-decoration: none;
}
a:hover { color: #0b6284; }

.auth-stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  position: relative;
  overflow: hidden;
}

.auth-visual {
  position: relative;
  isolation: isolate;
  padding: clamp(28px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  background:
    radial-gradient(900px 520px at 18% 12%, var(--glow), transparent 58%),
    radial-gradient(700px 480px at 88% 78%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(160deg, #1a9bc4 0%, #0f7ea8 48%, #0c5f7c 100%);
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 85%);
  animation: gridDrift 18s linear infinite;
}

.auth-visual::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 18%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffd27a, transparent);
  opacity: 0.7;
  transform: rotate(-6deg);
  box-shadow: 0 0 40px var(--glow);
  animation: roadPulse 3.2s ease-in-out infinite;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  background: linear-gradient(145deg, #f0a43a, #ffc56a);
  color: #3a2405;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.04em;
  box-shadow: 0 12px 40px rgba(15, 95, 124, 0.28);
  animation: riseIn 0.8s var(--ease) both;
}

.brand-title {
  margin: 0 0 14px;
  max-width: 11ch;
  font-family: "Syne", sans-serif;
  font-size: clamp(42px, 6.2vw, 72px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
  animation: riseIn 0.85s var(--ease) 0.12s both;
}

.brand-copy {
  margin: 0;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  animation: riseIn 0.85s var(--ease) 0.28s both;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  background: linear-gradient(180deg, #ffffff, #f7fbfe);
  border-left: 1px solid var(--line);
  animation: panelIn 0.7s var(--ease) 0.15s both;
}

.auth-panel-inner {
  width: min(420px, 100%);
  margin: 0 auto;
}

.auth-kicker {
  margin: 0 0 8px;
  color: var(--signal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-panel h1 {
  margin: 0 0 8px;
  font-family: "Syne", sans-serif;
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.lead {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.auth-nav {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 28px;
  font-size: 14px;
}
.auth-nav a { color: var(--muted); }
.auth-nav a:hover { color: var(--ink); }
.auth-nav .pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}
.auth-nav .pill:hover {
  border-color: rgba(15, 126, 168, 0.45);
  color: var(--signal-2);
}

label {
  display: block;
  margin: 0 0 7px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  margin-bottom: 14px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { padding: 12px 14px; min-height: 96px; resize: vertical; }
input:focus, textarea:focus {
  outline: none;
  border-color: rgba(15, 126, 168, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 126, 168, 0.12);
}

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

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}
.check input { margin-top: 3px; }
.remember-row {
  margin: 4px 0 16px;
  font-weight: 600;
  color: var(--ink);
}
.pwa-actions {
  margin: 18px 0 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(15, 126, 168, 0.06);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(15, 126, 168, 0.35);
  background: #fff;
  color: var(--signal-2);
  font-weight: 750;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.pwa-hint { margin: 10px 0 0; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--signal), #f0a84a);
  color: #3a2405;
  font-weight: 750;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: transform .18s ease, filter .18s ease;
}
button:hover, .btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 0 0 16px;
  font-size: 14px;
}
.alert.error { background: #fdeeee; color: var(--danger); }
.alert.success { background: #e6f7ee; color: var(--ok); }

.muted { color: var(--muted); font-size: 13px; }
.links {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.links a { color: var(--muted); }
.links a:hover { color: var(--signal-2); }

.shell {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}
.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}
.logo {
  font-family: "Syne", sans-serif;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.03em;
  font-weight: 700;
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}
.btn-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--signal), #f0a84a);
  color: #3a2405;
  font-weight: 700;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: 0 10px 28px rgba(21, 32, 51, 0.06);
}
.card h1 {
  margin: 0 0 8px;
  font-family: "Syne", sans-serif;
  font-size: 32px;
  letter-spacing: -0.03em;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 56px 56px, 56px 56px; }
}
@keyframes roadPulse {
  0%, 100% { opacity: .35; }
  50% { opacity: .75; }
}

@media (max-width: 900px) {
  .auth-stage { grid-template-columns: 1fr; }
  .auth-visual {
    min-height: auto;
    max-height: none;
    justify-content: flex-end;
    padding: 22px 20px 20px;
  }
  .auth-visual::after { bottom: 10%; }
  .auth-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 0 0 env(safe-area-inset-bottom, 0px);
  }
  .auth-panel-inner { padding: 22px 18px 32px; max-width: none; }
  .brand-mark { width: 44px; height: 44px; font-size: 18px; margin-bottom: 14px; border-radius: 14px; }
  .brand-title {
    max-width: none;
    font-size: clamp(28px, 8vw, 40px);
    margin-bottom: 8px;
  }
  .brand-copy { font-size: 14px; max-width: 36ch; }
  .auth-nav { margin-bottom: 18px; }
  h2.auth-heading, .auth-panel h1, .auth-panel .auth-title {
    font-size: clamp(26px, 7vw, 34px);
  }
}
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .auth-visual { padding: 18px 16px 16px; }
  .auth-panel-inner { padding: 18px 16px 28px; }
  button[type="submit"], .btn-primary, .btn-secondary {
    width: 100%;
    min-height: 48px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-visual::before,
  .auth-visual::after,
  .brand-mark,
  .brand-title,
  .brand-copy,
  .auth-panel { animation: none; }
}

button.linkish {
  display: inline;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--signal-2);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transform: none;
  filter: none;
}
button.linkish:hover {
  color: #0b6284;
  transform: none;
  filter: none;
}
.legal-modal[hidden] { display: none !important; }
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}
.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 32, 51, 0.55);
}
.legal-modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15, 32, 51, 0.28);
  overflow: hidden;
}
.legal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.legal-modal-head h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 20px;
  letter-spacing: -0.02em;
}
button.legal-close {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #f3f7fb;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}
button.legal-close:hover { transform: none; filter: none; }
.legal-modal-body {
  padding: 16px 18px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}
.legal-modal-body h3 {
  margin: 18px 0 8px;
  font-size: 15px;
  font-family: "Syne", sans-serif;
}
.legal-modal-body p { margin: 0 0 10px; }
.legal-modal-body ul {
  margin: 0 0 12px;
  padding-left: 18px;
}
.legal-modal-body li { margin-bottom: 6px; }
.legal-modal-foot {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: #f8fbfe;
}
.legal-modal-foot .muted { margin: 0 0 10px; }
.legal-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}
.legal-actions .btn[disabled],
#kvkk-accept:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}
@media (max-width: 560px) {
  .legal-actions { grid-template-columns: 1fr; }
  .legal-modal-card { max-height: 92vh; }
}
