:root {
  --bg-0: #eef1f8;
  --bg-1: #f7f9fc;
  --card: rgba(255, 255, 255, 0.92);
  --card-border: rgba(20, 30, 60, 0.08);
  --text: #141b2e;
  --text-soft: #4a5570;
  --muted: #8a93ad;
  --brand: #4b6bff;
  --brand-2: #7b5bff;
  --accent: #0fae82;
  --danger: #e23b56;
  --input-bg: #ffffff;
  --input-border: rgba(20, 30, 60, 0.14);
  --radius: 18px;
  --shadow: 0 24px 60px rgba(31, 45, 90, 0.14);
}

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

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

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(75, 107, 255, 0.12), transparent 60%),
    radial-gradient(900px 500px at 90% 110%, rgba(123, 91, 255, 0.1), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.logo-judini {
  width: 120px;
  max-width: 60%;
  height: auto;
  display: block;
  margin-bottom: 4px;
}

.logo-elevenlabs {
  width: 100px;
  height: auto;
  display: block;
  margin-top: 8px;
  opacity: 0.85;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  padding: 30px 24px 26px;
  text-align: center;
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(109, 139, 255, 0.35);
  background: rgba(109, 139, 255, 0.1);
}

.title {
  font-size: clamp(22px, 6.5vw, 28px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
  background: linear-gradient(90deg, #182142, #3a4a78);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
  max-width: 300px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

input {
  width: 100%;
  font-size: 16px; /* >=16px evita zoom en iOS */
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  outline: none;
}

input::placeholder {
  color: var(--muted);
}

input:focus {
  border-color: var(--brand);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(75, 107, 255, 0.16);
}

input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 107, 129, 0.16);
}

.phone {
  display: flex;
  gap: 10px;
  width: 100%;
}

.phone__prefix {
  width: 78px;
  flex: 0 0 78px;
  padding-left: 8px;
  padding-right: 8px;
  font-weight: 600;
}

.phone__number {
  flex: 1 1 auto;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.error {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--danger);
  min-height: 0;
  display: none;
}

.error.show {
  display: block;
}

.btn {
  position: relative;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 30px rgba(109, 139, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn:disabled {
  cursor: progress;
  opacity: 0.85;
}

.btn.is-loading .btn__label,
.btn.is-loading .btn__icon {
  visibility: hidden;
}

.btn__spinner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  display: none;
}

.btn.is-loading .btn__spinner {
  display: block;
  animation: spin 0.7s linear infinite;
}

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

.status {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
  min-height: 18px;
}

.status.success {
  color: var(--accent);
}

.status.error {
  color: var(--danger);
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.footer__credits {
  font-size: 11px;
  opacity: 0.85;
}

/* ---------------------------------------------------------------------------
   Modal "te estamos llamando"
   --------------------------------------------------------------------------- */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 22, 44, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade 0.2s ease both;
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 30px 26px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: pop 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal__pulse {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 0 rgba(75, 107, 255, 0.5);
  animation: ring 1.6s ease-out infinite;
}

.modal__title {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.modal__phone {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--brand);
  direction: ltr;
  unicode-bidi: plaintext;
}

.modal__hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.modal__close {
  margin-top: 10px;
  border: 1px solid var(--input-border);
  background: #fff;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.modal__close:active {
  background: #f1f3fa;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(75, 107, 255, 0.45); }
  70% { box-shadow: 0 0 0 18px rgba(75, 107, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(75, 107, 255, 0); }
}
