/* ============================================================
   Citycell · Crédito Total — shared styles
   Complements the Tailwind design-system config in index.html
   ============================================================ */

:root {
  --primary: #346b00;
  --primary-container: #76b843;
}

html, body { height: 100%; }
body {
  background-color: #fbf9f8;
  color: #1b1c1c;
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
}

/* Material Symbols defaults */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}
.material-symbols-outlined.fill { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

/* Scrollbars */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #e2dfde; border-radius: 10px; }

/* Press feedback */
.pressable { transition: transform .12s ease, filter .12s ease, background-color .15s ease, box-shadow .2s ease; }
.pressable:active { transform: scale(.96); filter: brightness(.97); }

/* Wallet gradient hero */
.balance-card-gradient {
  background: linear-gradient(135deg, #346b00 0%, #1b1c1c 100%);
}
.glass-effect { background: rgba(255,255,255,.1); backdrop-filter: blur(8px); }

/* Support chat background */
.gradient-mesh {
  background-color: #fbf9f8;
  background-image:
    radial-gradient(at 0% 0%, rgba(148, 217, 95, 0.10) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(52, 107, 0, 0.05) 0px, transparent 50%);
}

/* Chat bubbles */
.message-bubble-in  { border-bottom-left-radius: 4px; }
.message-bubble-out { border-bottom-right-radius: 4px; }

/* ---------- Animations ---------- */
@keyframes springIn {
  0%   { opacity: 0; transform: scale(.8) translateY(20px); }
  70%  { transform: scale(1.04) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.animate-spring { animation: springIn .45s cubic-bezier(.175,.885,.32,1.275) forwards; }

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(.3); }
  50%  { opacity: 1; transform: scale(1.1); }
  70%  { transform: scale(.9); }
  100% { transform: scale(1); }
}
.animate-bounce-in { animation: bounceIn .55s cubic-bezier(.68,-.55,.265,1.55) forwards; }

.stagger-1 { animation-delay: .07s; }
.stagger-2 { animation-delay: .14s; }
.stagger-3 { animation-delay: .21s; }
.stagger-4 { animation-delay: .28s; }
.stagger-5 { animation-delay: .35s; }
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }

/* ---------- Bottom sheet / modal ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 95; /* above the welcome gate (80) so the login sheet is usable */
  background: rgba(15,20,10,.45);
  opacity: 0; transition: opacity .25s ease;
}
.sheet-backdrop.open { opacity: 1; }

.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 28rem; margin: 0 auto;
  background: #ffffff;
  border-top-left-radius: 1.25rem; border-top-right-radius: 1.25rem;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  transform: translateY(100%); transition: transform .32s cubic-bezier(.32,.72,0,1);
  max-height: 90dvh; overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet-backdrop.open .sheet-panel { transform: translateY(0); }

.sheet-grabber {
  width: 40px; height: 4px; border-radius: 999px;
  background: #dbdad9; margin: 12px auto 4px;
}

/* ---------- Toast ---------- */
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  background: #303031; color: #f2f0f0;
  padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  max-width: 24rem; width: max-content;
  animation: toastIn .3s ease forwards;
}
.toast.success .toast-ic { color: #94d95f; }
.toast.error .toast-ic { color: #ff897d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.leaving { animation: toastOut .25s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }

/* Typing dots */
.typing-dot { width: 6px; height: 6px; border-radius: 999px; background: #5f5e5e; animation: typingBounce 1s infinite; }
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Number input clean */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Popup modal (design-system aligned) ---------- */
.popup-backdrop {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(15, 20, 10, .5);
  opacity: 0; transition: opacity .28s ease;
}
.popup-backdrop.open { opacity: 1; }

.popup-card {
  position: relative;
  width: 100%; max-width: 22rem;
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  overflow: hidden;
  text-align: center;
  transform: scale(.85) translateY(16px); opacity: 0;
  transition: transform .34s cubic-bezier(.175,.885,.32,1.275), opacity .26s ease;
}
.popup-backdrop.open .popup-card { transform: scale(1) translateY(0); opacity: 1; }

.popup-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.85); color: #5f5e5e; border: none; cursor: pointer;
}
.popup-image { height: 160px; background-size: cover; background-position: center; }
.popup-icon {
  margin: 28px auto 0; width: 72px; height: 72px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(52,107,0,.10); color: #346b00;
}
.popup-icon .material-symbols-outlined { font-size: 38px; }
.popup-body { padding: 20px 24px 24px; }
.popup-title {
  font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 22px; line-height: 28px;
  color: #1b1c1c; margin: 8px 0 6px;
}
.popup-message {
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; line-height: 22px;
  color: #41493a; margin: 0 0 18px;
}
.popup-cta {
  display: block; width: 100%; border: none; cursor: pointer;
  background: #346b00; color: #fff;
  font-family: 'Manrope', sans-serif; font-weight: 600; font-size: 15px;
  padding: 14px; border-radius: 12px;
  box-shadow: 0 8px 20px rgba(52,107,0,.25);
}
.popup-dismiss {
  display: block; width: 100%; margin-top: 10px; border: none; background: none; cursor: pointer;
  color: #5f5e5e; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; padding: 8px;
}

/* ---------- Welcome gate (real account vs demo) ---------- */
.cc-gate {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  background: linear-gradient(150deg, #346b00 0%, #1b1c1c 100%);
  opacity: 0; transition: opacity .35s ease;
}
.cc-gate.open { opacity: 1; }
.cc-gate-inner {
  width: 100%; max-width: 22rem; text-align: center; color: #fff;
  display: flex; flex-direction: column; align-items: center;
  transform: translateY(16px); transition: transform .4s cubic-bezier(.175,.885,.32,1.275);
}
.cc-gate.open .cc-gate-inner { transform: translateY(0); }
.cc-gate-mark {
  width: 88px; height: 88px; border-radius: 24px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #aff678, #76b843 55%, #1b1c1c);
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 52px; color: #fff;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
}
.cc-gate-title { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 40px; margin: 0; letter-spacing: -.02em; }
.cc-gate-tag { color: #94d95f; font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .42em; margin: 4px 0 0; }
.cc-gate-sub { color: rgba(255,255,255,.8); font-size: 15px; line-height: 22px; margin: 18px 0 28px; }
.cc-gate-primary {
  width: 100%; border: none; cursor: pointer; border-radius: 14px; padding: 16px;
  background: #fff; color: #1b1c1c; font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.cc-gate-primary:active { transform: scale(.97); }
.cc-gate-ghost {
  width: 100%; margin-top: 14px; border: none; background: none; cursor: pointer;
  color: rgba(255,255,255,.75); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; padding: 10px;
}
.cc-gate-ghost:hover { color: #fff; }
