@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@400;500;600;700&display=swap");

:root {
  --bg: #04060c;
  --bg-2: #090d18;
  --panel: rgba(14, 19, 34, 0.72);
  --panel-border: rgba(120, 170, 255, 0.18);
  --blue: #3f8cff;
  --blue-bright: #6fb7ff;
  --blue-glow: rgba(79, 156, 255, 0.55);
  --silver: #dfe4ee;
  --silver-dim: #aab2c5;
  --text: #eef1f8;
  --muted: #8b93a8;
  --error: #ff5d78;
  --success: #3fe0a8;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

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

body {
  background: radial-gradient(circle at 50% 0%, #0c1326 0%, var(--bg) 55%, #000 100%);
  color: var(--text);
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

/* Decorative ambient glows */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 480px;
  height: 480px;
  top: -160px;
  left: -140px;
  background: radial-gradient(circle, rgba(63, 140, 255, 0.32), transparent 70%);
}

body::after {
  width: 520px;
  height: 520px;
  bottom: -200px;
  right: -160px;
  background: radial-gradient(circle, rgba(63, 140, 255, 0.22), transparent 70%);
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* ---------- Botón volver al inicio ---------- */
.home-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--silver);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.home-btn svg {
  width: 20px;
  height: 20px;
}

.home-btn:hover {
  color: var(--blue-bright);
  border-color: rgba(111, 183, 255, 0.5);
}

.home-btn:active {
  transform: scale(0.94);
}

@supports (padding: max(0px)) {
  .home-btn {
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
  }
}

/* ---------- Screens ---------- */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.55s ease both;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Logo ---------- */
.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

@keyframes floatLogo {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ---------- Mac mockup (estilo MacBook Pro moderno) ---------- */
.mac {
  width: min(84vw, 440px);
  filter: drop-shadow(0 34px 50px rgba(0, 0, 0, 0.65));
  perspective: 900px;
}

.mac-screen {
  position: relative;
  background: linear-gradient(160deg, #eceef2 0%, #c3c6cd 38%, #8a8e97 78%, #757982 100%);
  border-radius: 16px 16px 4px 4px;
  padding: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), inset 0 -1px 2px rgba(0, 0, 0, 0.18);
}

.mac-display {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 11px;
  overflow: hidden;
  background: #000;
}

.mac-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 3%;
  animation: screenBreathe 6s ease-in-out infinite;
}

@keyframes screenBreathe {
  0%,
  100% {
    filter: drop-shadow(0 0 20px var(--blue-glow)) brightness(1);
  }
  50% {
    filter: drop-shadow(0 0 32px var(--blue-glow)) brightness(1.08);
  }
}

.mac-display::before {
  /* notch de cámara moderno */
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26%;
  height: 5.5%;
  min-height: 9px;
  background: #000;
  border-radius: 0 0 9px 9px;
  z-index: 2;
}

.mac-display::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  margin-top: 2.5px;
  border-radius: 50%;
  background: #262b36;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 3;
}

.mac-hinge {
  height: 4px;
  background: linear-gradient(180deg, #75798a, #40434c);
}

.mac-base {
  position: relative;
  height: 14px;
  background: linear-gradient(180deg, #dcdee3, #a3a7b0 55%, #90939c);
  border-radius: 0 0 13px 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 20px -6px rgba(0, 0, 0, 0.5);
}

.mac-base::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 15%;
  height: 4px;
  background: #888c96;
  border-radius: 0 0 7px 7px;
}

.slogan {
  font-family: "Orbitron", sans-serif;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: clamp(11px, 2.4vw, 14px);
  max-width: 420px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.slogan .slogan-line-1 {
  color: var(--muted);
  font-weight: 500;
}

.slogan .slogan-line-2 {
  color: var(--blue-bright);
  font-weight: 700;
  text-shadow: 0 0 18px var(--blue-glow);
}

/* ---------- Intro screen ---------- */
#screen-intro {
  gap: 40px;
  padding-top: 6vh;
}

.intro-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.intro-title {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 4.4vw, 26px);
  letter-spacing: 0.04em;
  color: var(--text);
}

.intro-subtitle {
  color: var(--muted);
  font-size: clamp(14px, 3vw, 16px);
  max-width: 380px;
  line-height: 1.5;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: "Orbitron", sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
  padding: 16px 36px;
  border-radius: 999px;
  color: #04060c;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue) 60%, #1f5fce);
  box-shadow: 0 0 0 1px rgba(111, 183, 255, 0.35), 0 12px 30px -8px var(--blue-glow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  width: 100%;
  max-width: 320px;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 0 0 1px rgba(111, 183, 255, 0.5), 0 16px 36px -6px var(--blue-glow);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.3);
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--silver);
  box-shadow: 0 0 0 1px var(--panel-border);
}

.btn-ghost:hover {
  box-shadow: 0 0 0 1px rgba(111, 183, 255, 0.5);
  filter: none;
}

/* ---------- Form card ---------- */
.card {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px 26px 28px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-align: left;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.card-header img {
  width: 76px;
  height: auto;
  filter: drop-shadow(0 0 16px var(--blue-glow));
}

.card-header h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  color: var(--text);
}

.card-header p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Fields ---------- */
.field {
  margin-bottom: 18px;
}

.field label {
  display: flex;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--silver-dim);
  margin-bottom: 8px;
}

.field label .opt {
  text-transform: none;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}

.field label .req {
  color: var(--blue-bright);
}

.input,
select.input,
textarea.input {
  width: 100%;
  background: rgba(6, 9, 18, 0.7);
  border: 1px solid rgba(140, 160, 200, 0.22);
  border-radius: 12px;
  padding: 13px 15px;
  color: var(--text);
  font-family: "Rajdhani", sans-serif;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.input {
  resize: vertical;
  min-height: 88px;
  font-family: "Rajdhani", sans-serif;
}

.input::placeholder {
  color: #5c6478;
}

.input:focus,
select.input:focus,
textarea.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.2);
}

.field.invalid .input,
.field.invalid select.input,
.field.invalid textarea.input {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(255, 93, 120, 0.15);
}

.error-msg {
  display: none;
  color: var(--error);
  font-size: 12.5px;
  margin-top: 6px;
  font-weight: 600;
}

.field.invalid .error-msg {
  display: block;
}

.phone-row {
  display: grid;
  grid-template-columns: minmax(112px, 38%) 1fr;
  gap: 10px;
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--silver-dim) 50%),
    linear-gradient(135deg, var(--silver-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.field-consent {
  margin-bottom: 8px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
}

.checkbox-row input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--blue);
  cursor: pointer;
}

.checkbox-row a {
  color: var(--blue-bright);
}

.field-consent.invalid .checkbox-row {
  color: var(--error);
}

.field-consent .error-msg {
  margin-top: 4px;
}

.form-footer {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.form-note {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.submit-error {
  display: none;
  width: 100%;
  background: rgba(255, 93, 120, 0.1);
  border: 1px solid rgba(255, 93, 120, 0.4);
  color: #ffb3c0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  text-align: center;
}

.submit-error.show {
  display: block;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(4, 6, 12, 0.35);
  border-top-color: #04060c;
  display: inline-block;
  margin-right: 8px;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

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

/* ---------- Success screen ---------- */
#screen-success {
  gap: 28px;
  padding-top: 8vh;
}

.check-circle {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(63, 224, 168, 0.18), transparent 70%);
  box-shadow: 0 0 0 1px rgba(63, 224, 168, 0.35);
  animation: popIn 0.5s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.check-circle svg {
  width: 40px;
  height: 40px;
}

.check-circle svg path {
  stroke: var(--success);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 0.5s 0.25s ease forwards;
}

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

.success-title {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: clamp(19px, 4.2vw, 24px);
  color: var(--text);
  letter-spacing: 0.03em;
}

.success-text {
  color: var(--muted);
  font-size: 15px;
  max-width: 360px;
  line-height: 1.6;
}

.success-logo {
  width: min(34vw, 120px);
  height: auto;
  filter: drop-shadow(0 0 20px var(--blue-glow));
  margin-top: 6px;
}

/* ---------- Responsive ---------- */
@media (max-width: 420px) {
  .app {
    padding: 22px 14px 36px;
  }

  .card {
    padding: 24px 18px 22px;
  }

  .phone-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .app {
    max-width: 620px;
  }

  .card {
    padding: 38px 40px 34px;
  }
}

/* Respect safe areas on iOS notches */
@supports (padding: max(0px)) {
  .app {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(48px, env(safe-area-inset-bottom));
  }
}
