/* ============================================================
   SIRO AUTH — cream paper, forest green ink
   Aligned with profile tokens (light theme)
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Surfaces — warm cream paper */
  --bg:        #F4EFE6;
  --surface:   #FBF8F2;
  --surface-2: #EDE6D8;
  --surface-3: #DDD3C0;

  /* Text — deep forest ink */
  --text:      #1E2A22;
  --text-2:    #4F5F54;
  --text-3:    #8C978A;

  /* Semantic — forest green brand */
  --green:     #1F6B4A;
  --green-bg:  #DCEBE2;
  --red:       #B23A2E;
  --red-bg:    rgba(178, 58, 46, 0.08);
  --amber:     #B4761E;
  --amber-bg:  #F3E4C8;

  /* Radii */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-pill: 999px;

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.s-app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ------------------------------------------------------------
   Brand
   ------------------------------------------------------------ */
.s-top { margin-bottom: 20px; }

.s-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.s-logo {
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--surface);
  flex-shrink: 0;
  box-shadow: 0 6px 18px -8px rgba(31, 107, 74, 0.55);
}

.s-logo img, .s-logo svg {
  width: 100%;
  height: 100%;
  border-radius: var(--r-md);
  object-fit: cover;
}

.s-brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.s-brand-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text);
}

.s-brand-tag {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
  font-style: italic;
}

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */
.s-card {
  background: var(--surface);
  border: 1px solid var(--surface-3);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.s-card--hero {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(31, 107, 74, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-color: rgba(31, 107, 74, 0.20);
}

/* ------------------------------------------------------------
   Preview card (mirrors profile's wallet card)
   ------------------------------------------------------------ */
.s-preview { margin-bottom: 16px; }

.s-preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.s-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12%;
  background: var(--green-bg);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(31, 107, 74, 0.30);
}

.s-preview-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.s-preview-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.s-seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: var(--r-pill);
  padding: 3px;
  margin-bottom: 12px;
}

.s-seg-btn {
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.s-seg-btn.is-active {
  background: var(--green);
  color: var(--surface);
}

.s-preview-total {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.s-preview-stats {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
}

/* ------------------------------------------------------------
   Trust strip
   ------------------------------------------------------------ */
.s-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 4px 4px 20px;
}

.s-trust li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
}

.s-trust li i {
  color: var(--green);
  font-size: 11px;
}

/* ------------------------------------------------------------
   Auth card
   ------------------------------------------------------------ */
.s-auth { margin-bottom: 20px; }

.s-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: var(--r-md);
  padding: 3px;
  margin-bottom: 20px;
  gap: 3px;
}

.s-switch-btn {
  padding: 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  transition: background .2s, color .2s;
}

.s-switch-btn.active {
  background: var(--green);
  color: var(--surface);
  box-shadow: 0 4px 14px -8px rgba(31, 107, 74, 0.6);
}

/* Forms */
.s-form { display: none; }
.s-form.active { display: block; animation: s-rise .25s ease; }

@keyframes s-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.s-field { margin-bottom: 14px; }

.s-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

.s-optional {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

/* Inputs */
.s-input {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1.5px solid var(--surface-3);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.s-input:focus-within {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(31, 107, 74, 0.15);
}

.s-input.is-invalid {
  border-color: var(--red);
  background: var(--red-bg);
}

.s-input input {
  flex: 1;
  min-width: 0;
  padding: 14px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
}

.s-input input::placeholder {
  color: var(--text-3);
  font-weight: 400;
}

/* Country prefix */
.s-prefix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--surface-2);
  border-right: 1px solid var(--surface-3);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.s-prefix--btn { cursor: pointer; }
.s-prefix--btn:active { background: var(--surface-3); }

.s-prefix-chev {
  font-size: 10px;
  color: var(--text-3);
  margin-left: 2px;
}

.s-flag { font-size: 16px; line-height: 1; }
.s-dial { font-variant-numeric: tabular-nums; }

/* Eye */
.s-eye {
  padding: 0 14px;
  color: var(--text-3);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}

.s-eye:hover { color: var(--green); }

/* Help + error */
.s-help {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.4;
}

.s-error {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  margin-top: 6px;
}

/* CTA */
.s-cta {
  width: 100%;
  padding: 15px;
  min-height: 52px;
  margin-top: 4px;
  border-radius: var(--r-md);
  background: var(--green);
  color: var(--surface);
  font-size: 15px;
  font-weight: 700;
  transition: transform .12s, opacity .15s, box-shadow .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px -12px rgba(31, 107, 74, 0.7);
}

.s-cta:active:not(:disabled) { transform: scale(.98); }
.s-cta:disabled { opacity: .5; cursor: not-allowed; }

/* Foot */
.s-foot {
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 16px;
}

.s-foot a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

.s-foot a:hover { text-decoration: underline; }

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */
.s-contact { margin-bottom: 20px; }

.s-contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--text);
  margin-bottom: 10px;
  transition: background .15s, border-color .15s;
}

.s-contact-row:active,
.s-contact-row:hover {
  background: var(--surface-2);
  border-color: rgba(31, 107, 74, 0.30);
}

.s-contact-row i:first-child {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.s-contact-label {
  font-size: 11px;
  color: var(--text-3);
}

.s-contact-value {
  font-size: 14px;
  font-weight: 600;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.s-contact-chev {
  color: var(--green);
  font-size: 12px;
  margin-left: auto;
}

.s-contact-loc {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 0;
}

.s-contact-loc i { color: var(--green); margin-right: 4px; }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.s-footer {
  text-align: center;
  margin-top: 24px;
}

.s-sig {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
}

/* ------------------------------------------------------------
   Country picker — sheet
   ------------------------------------------------------------ */
.country-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}

.country-sheet[hidden] { display: none; }

.country-sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(30, 42, 34, 0.45);
  pointer-events: auto;
  animation: s-fade .18s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

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

.country-sheet__panel {
  position: relative;
  width: 100%;
  max-height: 75vh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  overflow: hidden;
  animation: s-up .26s cubic-bezier(.32, 1, .6, 1);
  box-shadow: 0 -20px 60px -30px rgba(30, 42, 34, 0.5);
}

@keyframes s-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.country-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--surface-3);
}

.country-sheet__close {
  color: var(--text-2);
  font-size: 16px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}

.country-sheet__close:hover {
  background: var(--surface-2);
  color: var(--green);
}

.country-sheet__search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--surface-3);
  color: var(--text-3);
  background: var(--surface-2);
}

.country-sheet__search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}

.country-sheet__search input::placeholder { color: var(--text-3); }

.country-sheet__list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.country-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background .12s;
}

.country-item:hover,
.country-item:active { background: var(--surface-2); }

.country-item.is-active {
  background: var(--green-bg);
}

.country-item.is-active::after {
  content: "●";
  color: var(--green);
  font-size: 10px;
  margin-left: auto;
}

.country-item__flag { font-size: 18px; }
.country-item__name { flex: 1; font-weight: 500; color: var(--text); }
.country-item__dial { color: var(--text-2); font-variant-numeric: tabular-nums; }

.country-item--empty {
  justify-content: center;
  color: var(--text-3);
  cursor: default;
  padding: 24px;
}

/* ------------------------------------------------------------
   Toast
   ------------------------------------------------------------ */
.s-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -12px);
  z-index: 9999;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--surface);
  background: var(--text);
  box-shadow: 0 10px 30px -10px rgba(30, 42, 34, 0.4);
  opacity: 0;
  transition: transform .24s, opacity .24s;
  pointer-events: none;
}

.s-toast.show { transform: translate(-50%, 0); opacity: 1; }
.s-toast.success { background: var(--green); color: var(--surface); }
.s-toast.error   { background: var(--red); color: var(--surface); }
.s-toast.warning { background: var(--amber); color: var(--surface); }

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ------------------------------------------------------------
   Community groups — WhatsApp / Telegram
   ------------------------------------------------------------ */
.s-contact-row--group {
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
}

.s-contact-row--group:active,
.s-contact-row--group:hover {
  background: var(--surface-3);
}

/* Icon tiles get brand colors */
.s-contact-row--group i.fa-whatsapp {
  background: rgba(37, 211, 102, 0.14);
  color: #1F9D57;
}

.s-contact-row--group i.fa-telegram-plane,
.s-contact-row--group i.fa-telegram {
  background: rgba(34, 158, 217, 0.14);
  color: #1B7FA8;
}

/* Slightly tighter spacing between the two group rows */
.s-contact-row--group + .s-contact-row--group {
  margin-top: -2px;
}