/* ===== Reset / Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Display', Segoe UI, Roboto, sans-serif;
  color: #0b1220;
  background:
    radial-gradient(1200px 600px at 10% -10%, #e0f2fe 0%, transparent 60%),
    radial-gradient(1200px 600px at 110% 10%, #ffe4e6 0%, transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  min-height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

/* ===== Theme Tokens ===== */
:root {
  --gold: #f59e0b;
  --gold-deep: #d97706;
  --red: #e11d48;
  --red-deep: #be123c;
  --card-bg: rgba(255, 255, 255, 0.84);
  --text: #0b1220;
  --muted: #475569;
  --chip-bg: #ffffff;
  --border: rgba(15, 23, 42, 0.10);
  --orb1: #93c5fd;
  --orb2: #fca5a5;
  --btn-grad: linear-gradient(135deg, #f59e0b, #e11d48);
  --btn-shadow: 0 4px 0 #9f1239, 0 10px 22px rgba(190, 18, 60, 0.26);
  --btn-shadow-h: 0 6px 0 #9f1239, 0 14px 28px rgba(190, 18, 60, 0.32);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
}

/* Decorative background orbs */
.bg-orb {
  position: fixed;
  inset: auto auto 10% -10%;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.45;
  z-index: 0;
  pointer-events: none;
}
.orb-1 { background: var(--orb1); left: -8%; bottom: 12%; }
.orb-2 { background: var(--orb2); right: -8%; top: 8%; }

/* ===== Card Layout ===== */
.card {
  position: relative;
  width: min(720px, 94vw);
  background: linear-gradient(180deg, var(--card-bg), rgba(255, 255, 255, 0.72));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 30px;
  padding: clamp(20px, 4.5vw, 32px);
  box-shadow: 
    0 24px 48px -12px rgba(2, 8, 23, 0.10),
    0 0 0 1px rgba(15, 23, 42, 0.04),
    inset 0 1px 1px rgba(255, 255, 255, 0.95);
  z-index: 1;
  animation: floatIn 0.65s var(--ease-spring);
  user-select: none;
  -webkit-user-select: none;
}
@keyframes floatIn {
  from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.98); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.brand {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  align-items: center;
}

.logo-wrapper {
  position: relative;
  width: 88px;
  height: 88px;
}

.logo {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 20px rgba(2, 8, 23, 0.08);
  background: #fff;
  display: block;
}

.online-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #10b981;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.badge-row {
  margin-bottom: 4px;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.10);
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.title h1 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: clamp(20px, 3.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
  font-weight: 700;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

/* ===== Clickable Tactile CTA Buttons ===== */
.cta-row {
  margin: 20px 0 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  touch-action: manipulation;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s var(--ease-spring), box-shadow 0.12s ease, filter 0.12s ease;
}

.btn.primary {
  background: var(--btn-grad);
  color: #fff;
  box-shadow: var(--btn-shadow);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-shadow-h);
  filter: brightness(1.04);
}
.btn.primary:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 1px 0 #9f1239, 0 3px 8px rgba(190, 18, 60, 0.2);
}

.btn.outline {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.08), 0 6px 16px rgba(2, 6, 23, 0.05);
}
.btn.outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(15, 23, 42, 0.08), 0 10px 22px rgba(2, 6, 23, 0.08);
}
.btn.outline:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08), 0 2px 6px rgba(2, 6, 23, 0.04);
  background: #f8fafc;
}

/* ===== Tactile Native Social App Icons ===== */
.social {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  grid-auto-rows: 48px;
  gap: 12px;
  justify-items: center;
  align-items: center;
  padding: 12px 0 6px;
  margin: 6px 0 2px;
  list-style: none;
}

.social-link {
  text-decoration: none !important;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.07), 0 6px 14px rgba(2, 8, 23, 0.05);
  touch-action: manipulation;
  cursor: pointer;
  transition: transform 0.12s var(--ease-spring), box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.social-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 0 rgba(15, 23, 42, 0.08), 0 12px 24px rgba(2, 8, 23, 0.09);
  border-color: rgba(15, 23, 42, 0.20);
}
.social-link:active {
  transform: translateY(2px) scale(0.92);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08), 0 2px 6px rgba(2, 8, 23, 0.04);
  background: #f1f5f9;
}

.social-link i {
  font-size: 20px;
  line-height: 1;
  color: red;
  transition: transform 0.15s ease, color 0.15s ease;
}
.social-link:hover i {
  color: #be123c;
  transform: scale(1.08);
}

/* ===== Action Chips ===== */
.actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 2px 0 rgba(15, 23, 42, 0.06), 0 4px 10px rgba(2, 8, 23, 0.04);
  transition: transform 0.12s var(--ease-spring), box-shadow 0.12s ease, background 0.12s ease;
  text-decoration: none;
  color: var(--text);
}

.chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 rgba(15, 23, 42, 0.08), 0 8px 16px rgba(2, 8, 23, 0.07);
}
.chip:active {
  transform: translateY(2px) scale(0.95);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  background: #f8fafc;
}

.foot {
  margin-top: 18px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
}

/* ===== Toast Notification ===== */
#toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: rgba(11, 18, 32, 0.94);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(2, 8, 23, 0.28);
  transition: opacity 0.2s var(--ease-spring), transform 0.2s var(--ease-spring);
  pointer-events: none;
  z-index: 110;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Native Bottom-Sheet Modals ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 23, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-spring);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: relative;
  width: min(500px, 92vw);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  padding: 26px;
  box-shadow: 0 25px 50px -12px rgba(2, 8, 23, 0.30);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s var(--ease-spring);
}

.modal-handle {
  display: none;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px;
  align-items: center;
}

.modal-logo {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.modal h2 {
  margin: 0 0 3px;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.modal-desc {
  color: #475569;
  font-size: 13px;
  margin: 12px 0 18px;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-actions .btn {
  flex: 1;
  min-width: 140px;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 0;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  color: var(--muted);
  transition: background-color 0.15s ease;
}
.modal-close:hover {
  background: rgba(15, 23, 42, 0.12);
}

/* Install Instructions Steps */
.install-instructions {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #1e293b;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* ===== Mobile Tuning (iOS Sheet & Large Touch Targets) ===== */
@media (max-width: 520px) {
  .wrap { padding: max(12px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom)) 12px; }
  .card { width: 100%; border-radius: 26px; padding: 20px 16px; }
  .cta-row { grid-template-columns: 1fr; gap: 10px; }
  .social { grid-template-columns: repeat(4, 50px); justify-content: center; gap: 12px; }
  .social-link { width: 50px; height: 50px; border-radius: 16px; }
  .brand { grid-template-columns: 72px 1fr; gap: 14px; }
  .logo-wrapper, .logo { width: 72px; height: 72px; border-radius: 18px; }
  
  /* Bottom-sheet popup on small phones */
  .modal-backdrop {
    align-items: flex-end;
  }
  .modal {
    width: 100%;
    border-radius: 28px 28px 0 0;
    padding: 18px 20px max(24px, env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
  .modal-handle {
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 0 auto 14px;
  }
  .modal-backdrop.open .modal {
    transform: translateY(0);
  }
}

/* ---- Small tablet tuning ---- */
@media (min-width: 521px) and (max-width: 768px) {
  .social { grid-template-columns: repeat(6, 48px); }
}

/* ==========================================================================
   Visitor Self-Identification & Personalized Greeting Styles
   ========================================================================== */

/* Personalized Welcome Pill */
.visitor-welcome-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(225, 29, 72, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 8px 14px;
  border-radius: 999px;
  margin: 16px 0 6px;
  font-size: 13px;
  color: #0f172a;
  animation: floatIn 0.35s var(--ease-spring);
}
.visitor-welcome-pill .welcome-text {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-edit-visitor {
  background: none;
  border: none;
  color: #64748b;
  font-size: 12px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.btn-edit-visitor:hover {
  color: var(--gold-deep);
  background: rgba(245, 158, 11, 0.15);
}

/* Self Identify Prompt Card */
.self-identify-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(254, 243, 199, 0.6));
  border: 1.5px dashed rgba(245, 158, 11, 0.5);
  border-radius: 20px;
  padding: 12px 14px;
  margin: 16px 0 8px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
  transition: transform 0.15s, border-color 0.15s;
  animation: floatIn 0.4s var(--ease-spring);
}
.self-identify-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.self-identify-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #e11d48);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.25);
}
.self-identify-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.self-identify-text strong {
  font-size: 13px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.self-identify-text span {
  font-size: 11px;
  color: #64748b;
  line-height: 1.25;
}
.btn-self-identify {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}
.btn-self-identify:active {
  transform: scale(0.94);
}
.btn-self-identify:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
}

/* Self-Identify Modal Form */
.modal-avatar-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #e11d48);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.25);
}
.self-identify-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.form-group-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}
.form-group-card label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.form-group-card label .req {
  color: #e11d48;
}
.form-group-card label .opt {
  color: #94a3b8;
  font-weight: 400;
  font-size: 11px;
}
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-icon i {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}
.input-with-icon input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  border-radius: 14px;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.input-with-icon input:focus {
  border-color: var(--red);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}
.input-with-icon input::placeholder {
  color: #94a3b8;
  font-size: 13px;
}
.mt-3 {
  margin-top: 12px;
}

