:root {
  --bg:        #050607;
  --panel:     #08090b;
  --field:     #0e1013;
  --field-br:  #1c1f24;
  --field-br2: #2a2e35;
  --text:      #e9edf2;
  --muted:     #8b9199;
  --muted-2:   #5c626b;
  --silver-1:  #f4f6f8;
  --silver-2:  #b9c0c7;
  --silver-3:  #7e858d;
  --accent:    #67e8f9;
  --accent-dim:rgba(103, 232, 249, 0.14);
  --radius:    14px;
  --ease:      cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Scrollbars tema oscuro */
* { scrollbar-width: thin; scrollbar-color: #2a2f37 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #23272e; border: 2px solid var(--bg); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a4049; }

html, body { height: 100%; max-width: 100%; overflow-x: hidden; }

body {
  font-family: 'Inter', system-ui, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

.stage {
  display: grid;
  grid-template-columns: 1fr clamp(360px, 30%, 480px);
  height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: #000;
}

/* Permite que las columnas del grid se encojan sin desbordar */
.video-pane,
.access { min-width: 0; }

/* ============================ Mitad izquierda: video ============================ */
.video-pane {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 90% at 40% 45%, #0a0c0f 0%, #050607 70%, #020304 100%);
}

.bg-video {
  width: 100%;
  height: 100%;
  object-fit: contain;          /* escena COMPLETA: no recorta camión ni mapa */
  object-position: bottom center; /* marca de agua pegada al borde inferior, bajo el degradado */
}

/* Degradado inferior que oculta la marca de agua del video sin recortar la escena */
.video-pane::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 13%;
  background: linear-gradient(to top, #050607 0%, #050607 45%, rgba(5,6,7,0.8) 70%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

/* ============================ Mitad derecha: acceso ============================ */
.access {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  overflow-y: auto;
  padding: clamp(18px, 3.5vh, 44px) clamp(26px, 3vw, 56px);
  border-left: 1px solid #14171b;
  background:
    radial-gradient(120% 60% at 80% 0%, rgba(103,232,249,.05), transparent 60%),
    var(--panel);
}

.access__inner {
  width: 100%;
  max-width: 400px;
  min-width: 0;
  margin: 0 auto;
}

.brand { margin-bottom: clamp(22px, 4vh, 40px); }
.brand__logo {
  width: clamp(190px, 70%, 280px);
  height: auto;
  display: block;
}

.welcome { margin-bottom: clamp(20px, 3.5vh, 32px); }
.welcome__title {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: .28em;
  color: #fff;
}
.welcome__rule {
  display: block;
  width: 54px; height: 3px;
  margin: 14px 0 18px;
  background: linear-gradient(90deg, var(--silver-1), var(--silver-3));
  border-radius: 2px;
}
.welcome__sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 34ch;
}

/* ---------------------------- Form ---------------------------- */
.form { display: flex; flex-direction: column; gap: 14px; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--field);
  border: 1px solid var(--field-br);
  border-radius: var(--radius);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field:focus-within {
  border-color: var(--field-br2);
  box-shadow: 0 0 0 1px rgba(103,232,249,.18), 0 0 22px rgba(103,232,249,.08);
}

.field__icon {
  display: grid; place-items: center;
  width: 50px; height: 52px;
  color: var(--muted-2);
  flex: none;
}
.field__icon svg { width: 20px; height: 20px; }

.field input {
  flex: 1;
  min-width: 0;
  height: 52px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  letter-spacing: .01em;
  padding-right: 14px;
}
.field input::placeholder { color: var(--muted-2); }
.field--code input { letter-spacing: .28em; }

.field__action {
  background: none; border: none; cursor: pointer;
  color: var(--muted-2); padding: 0 16px; height: 52px;
  display: grid; place-items: center;
  transition: color .2s var(--ease);
}
.field__action:hover { color: var(--silver-2); }
.field__action svg { width: 20px; height: 20px; }

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.field--code {
  flex: 1 1 190px;
  min-width: 0;
}

.btn-ghost {
  flex: 1 1 auto;        /* ocupa su ancho; si no cabe, baja a su propia línea */
  height: 52px;
  white-space: nowrap;
  padding: 0 20px;
  border-radius: var(--radius);
  background: #101317;
  border: 1px solid var(--field-br2);
  color: var(--silver-1);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 18px rgba(103,232,249,.12);
}
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }

.message {
  font-size: 13px;
  min-height: 18px;
  letter-spacing: .01em;
  transition: color .2s var(--ease);
}
.message.error   { color: #fb7185; }
.message.success { color: var(--accent); }
.message.info    { color: var(--muted); }

.btn-primary {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 56px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(180deg, #ffffff, #e4e8ec);
  color: #07080a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .18em;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .3s var(--ease), opacity .2s;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.btn-primary svg { width: 22px; height: 22px; transition: transform .3s var(--ease); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 40px rgba(103,232,249,.18); }
.btn-primary:hover:not(:disabled) svg { transform: translateX(5px); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: progress; }

/* ---------------------------- Acceso seguro ---------------------------- */
.secure { margin-top: clamp(26px, 4vh, 40px); }
.secure__label {
  display: block;
  text-align: center;
  font-size: 11px;
  letter-spacing: .34em;
  color: var(--silver-3);
  position: relative;
  margin-bottom: 22px;
}
.secure__label::before,
.secure__label::after {
  content: ""; position: absolute; top: 50%; width: 22%; height: 1px;
  background: linear-gradient(90deg, transparent, #20242a);
}
.secure__label::before { left: 0; }
.secure__label::after  { right: 0; transform: scaleX(-1); }

/* Redes sociales de KÖNNEN: fila de iconos circulares centrados. */
.social {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 0;
  margin: 0;
}
.social a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #20242a;
  color: var(--silver-2);
  background: rgba(255, 255, 255, .02);
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.social a:hover,
.social a:focus-visible {
  color: #fff;
  border-color: var(--silver-3);
  background: rgba(255, 255, 255, .07);
  transform: translateY(-2px);
}
.social svg { width: 20px; height: 20px; }

.copyright {
  text-align: center;
  margin-top: clamp(22px, 3.5vh, 34px);
  font-size: 10.5px;
  letter-spacing: .18em;
  color: #3c4147;
}

/* ============================ Responsive ============================ */
@media (max-width: 820px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 100vh;
  }
  .video-pane { height: 34vh; }
  .access {
    border-left: none;
    border-top: 1px solid #14171b;
    justify-content: flex-start;
    padding-top: clamp(24px, 5vh, 48px);
  }
}

@media (max-width: 480px) {
  .welcome__title { font-size: clamp(26px, 8vw, 34px); letter-spacing: .14em; }
  .social a { width: 38px; height: 38px; }
}
