* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Inter, system-ui, sans-serif;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 40%);
  color: #0f172a;
  padding: max(12px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom));
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.lg-wrap { max-width: 440px; margin: 0 auto; }

.lg-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.lg-top h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lg-sub {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.4;
}

.lg-nav {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.lg-nav a {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
}

.lg-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.1);
  border: 1px solid #e2e8f0;
}

.lg-signin { text-align: center; padding: 32px 20px; }
.lg-signin h1 { margin: 0 0 8px; font-size: 1.2rem; }
.lg-signin p { color: #64748b; margin: 0 0 16px; }

.lg-field { margin-bottom: 14px; }
.lg-field-grow { flex: 1; min-width: 0; }

label, .lg-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.lg-opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: #cbd5e1; }

input[type="text"],
input[type="tel"],
input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  color: #0f172a;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

#lgPhone {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.lg-phone-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.lg-paste {
  flex-shrink: 0;
  padding: 12px 14px;
  border: 1.5px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.lg-hint {
  margin: -8px 0 10px;
  font-size: 0.75rem;
  color: #16a34a;
  font-weight: 600;
}

.lg-existing-card {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 12px;
  color: #854d0e;
}

.lg-existing-title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 0.875rem;
}

.lg-existing-body {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.lg-existing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lg-existing-actions .lg-btn {
  flex: 1;
  min-width: 110px;
  text-align: center;
  text-decoration: none;
  font-size: 0.8125rem;
  padding: 10px 12px;
}

.lg-existing {
  margin: -6px 0 12px;
  padding: 8px 10px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 10px;
  font-size: 0.8125rem;
  color: #854d0e;
}

.lg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lg-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
}

.lg-chip.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.lg-outcomes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lg-outcome {
  padding: 14px 10px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lg-outcome.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 1px #2563eb;
}

.lg-outcome--wa.active { border-color: #16a34a; background: #f0fdf4; color: #15803d; box-shadow: 0 0 0 1px #16a34a; }
.lg-outcome--bad.active { border-color: #94a3b8; background: #f1f5f9; color: #475569; }

.lg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.lg-btn-block { width: 100%; margin-top: 4px; }
.lg-btn-primary { background: #2563eb; color: #fff; }
.lg-btn-primary:disabled { opacity: 0.55; cursor: wait; }
.lg-btn-ghost { background: #f1f5f9; color: #0f172a; }
.lg-btn-wa { background: #16a34a; color: #fff; }

.lg-msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.lg-msg.ok { background: #dcfce7; color: #166534; }
.lg-msg.err { background: #fee2e2; color: #991b1b; }

.lg-success {
  background: #fff;
  border: 2px solid #22c55e;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
  text-align: center;
}

.lg-success-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #166534;
}

.lg-success-sub {
  margin: 6px 0 16px;
  font-size: 0.875rem;
  color: #475569;
}

.lg-success-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lg-tip {
  margin-top: 14px;
  padding: 12px 14px;
  background: #eff6ff;
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  font-size: 0.78rem;
  color: #1e40af;
  line-height: 1.45;
}

.lg-tip strong { display: block; margin-bottom: 4px; }
.lg-tip-warn {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}
.lg-steps {
  margin: 8px 0 8px 18px;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1.5;
}
.lg-steps li { margin-bottom: 4px; }
.lg-steps-note {
  margin: 0;
  font-size: 0.75rem;
  color: #c2410c;
}
