/* Participant form (/katil), mobile first. Shares the congress palette with /ekran. */
:root {
  --bg-deep: #031330;
  --accent: #4fd8ff;
  --accent-light: #c4f4ff;
  --accent-dark: #1683c9;
  --accent-glow: rgba(79, 216, 255, 0.4);
  --text: #f2f8ff;
  --muted: rgba(226, 240, 255, 0.72);
  --glass: rgba(4, 24, 64, 0.78);
  --glass-border: rgba(120, 210, 255, 0.26);
  --input-bg: rgba(2, 14, 38, 0.7);
  --success: #34d399;
  --danger: #f87171;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  line-height: 1.45;
  /* Matches the side videos' base blue (#01397e) so their faded edges blend in. */
  background: radial-gradient(ellipse 80% 70% at 50% 45%, #01397e, #022a63 60%, #031a42);
  background-color: #022a63;
}

/* ---------- Side animations (looping videos cut from the congress animation) ---------- */
.side-anim {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.side {
  position: absolute;
  top: 50%;
  width: min(calc((100vw - 520px) / 2 + 140px), 760px);
  height: auto;
  transform: translateY(-50%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.side-left {
  left: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 60%, transparent), linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, #000 60%, transparent), linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
}
.side-right {
  right: 0;
  -webkit-mask-image: linear-gradient(270deg, #000 60%, transparent), linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(270deg, #000 60%, transparent), linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
}

/* Phones: the form fills the width, so the animations glow softly behind the glass card. */
@media (max-width: 900px) {
  .side { width: 90vw; opacity: 0.8; transform: none; }
  .side-left { left: -22vw; top: auto; bottom: -4vh; }
  .side-right { right: -45vw; top: 12vh; }
}

/* ---------- Brand header ---------- */
/* Association logo (left) · congress names (centre); the empty third column keeps the names centred. */
.brand {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  grid-template-areas: "assoc text .";
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 560px;
  margin-bottom: 18px;
}
.brand-logo {
  grid-area: assoc;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 6px 20px rgba(0, 0, 0, 0.4);
}
/* Organizer logo, bottom right. Navy on white; a white badge keeps it legible on the dark page. */
.org-badge {
  flex: none;
  display: block;
  padding: 6px 10px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 6px 20px rgba(0, 0, 0, 0.4);
}
.org-badge img {
  display: block;
  width: auto;
  height: 40px;
}
.brand-text {
  grid-area: text;
  text-align: center;
}
.brand-text p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.brand-text .brand-meta {
  margin-top: 4px;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* Narrow phones: slightly smaller logo and text so the names stay centred on one side-by-side row. */
@media (max-width: 520px) {
  .brand { grid-template-columns: 52px 1fr 52px; gap: 10px; }
  .brand-logo { width: 52px; height: 52px; }
  .brand-text p { font-size: 12px; }
  .org-badge img { height: 34px; }
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 480px;
  padding: 24px 20px 26px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--glass-border), transparent);
}
h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}
.muted { color: var(--muted); margin: 0; }
.lead { margin-bottom: 18px; font-size: 15px; }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-light);
}
input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 17px; /* >=16px prevents iOS zoom on focus */
  color: var(--text);
  background: var(--input-bg);
  border: 1.5px solid rgba(120, 210, 255, 0.3);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79, 216, 255, 0.18);
}

.kvkk {
  margin: 18px 0 12px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(2, 14, 38, 0.5);
}
.kvkk summary {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-light);
  cursor: pointer;
}
.kvkk p {
  margin: 0;
  padding: 0 14px 14px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
}

.checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 18px;
  font-weight: 400;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.checkbox input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.error {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #ffd2d2;
  font-size: 14px;
  font-weight: 600;
}

.submit {
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--bg-deep);
  background: linear-gradient(145deg, var(--accent-light), var(--accent) 50%, var(--accent-dark));
  box-shadow: 0 10px 30px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.submit:active { transform: scale(0.98); }
.submit:disabled { opacity: 0.6; cursor: wait; }

/* ---------- States ---------- */
.state { text-align: center; padding: 8px 0; }
.state h1 { margin-top: 4px; }
.icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 6px auto 14px;
  border-radius: 50%;
  font-size: 32px;
  font-weight: 900;
}
.icon-success {
  color: #052e1c;
  background: var(--success);
  box-shadow: 0 0 30px rgba(52, 211, 153, 0.45);
  animation: pop 0.6s cubic-bezier(0.2, 0.9, 0.25, 1.3);
}
.icon-closed {
  color: #fff;
  background: var(--danger);
  box-shadow: 0 0 30px rgba(248, 113, 113, 0.4);
}
.code {
  margin: 8px 0 14px;
  padding: 14px 10px;
  border-radius: 14px;
  background: var(--input-bg);
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 30px rgba(79, 216, 255, 0.2);
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
  user-select: all;
}
.joined-name { margin: 0; font-size: 20px; font-weight: 800; }
.joined-institution { margin: 2px 0 0; color: var(--muted); }
.notice {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(79, 216, 255, 0.08);
  border: 1px solid var(--glass-border);
  font-size: 14px;
  text-align: left;
}
.notice strong { color: var(--accent-light); }

.spinner {
  display: block;
  width: 36px;
  height: 36px;
  margin: 10px auto;
  border: 3px solid rgba(79, 216, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---------- Footer ---------- */
.foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-top: auto;
  padding-top: 20px;
  font-size: 12px;
  color: var(--muted);
}
.foot-text { padding-bottom: 4px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
