/* ============================================================
   OneHome IL — design system
   Language: "official like a government site, inviting like an app"
   Deep institutional blue + warm gold, generous touch targets,
   fast on cheap Android phones (no heavy libs, system fallbacks).
   ============================================================ */

:root {
  --navy-900: #071F4D;
  --navy-800: #0B3D91;
  --navy-700: #14489C;
  --navy-100: #E3EAF7;
  --gold-500: #D4A72C;
  --gold-100: #FBF3DC;
  --ink: #17233B;
  --muted: #5A6B8C;
  --bg: #F3F6FC;
  --card: #FFFFFF;
  --ok: #1E8E4E;
  --warn: #C77700;
  --danger: #C0392B;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(7, 31, 77, .08);
  --shadow-lg: 0 12px 34px rgba(7, 31, 77, .16);
  --font: 'Noto Sans', 'Noto Sans Hebrew', 'Noto Sans Devanagari',
          'Noto Sans Thai', 'Noto Sans Sinhala', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--navy-800); text-decoration: none; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }

.container { max-width: 640px; margin: 0 auto; padding: 0 18px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px;
  border: 0; border-radius: 14px; cursor: pointer;
  font: 600 17px var(--font);
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff; box-shadow: 0 6px 18px rgba(11, 61, 145, .35);
  width: 100%;
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(11, 61, 145, .45); }
.btn-gold {
  background: linear-gradient(135deg, #E2B93B, var(--gold-500));
  color: var(--navy-900); box-shadow: 0 6px 18px rgba(212, 167, 44, .4);
  width: 100%;
}
.btn-ghost {
  background: #fff; color: var(--navy-800);
  border: 1.5px solid var(--navy-100);
}
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: 14px; border-radius: 10px; width: auto; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 14px;
}
.card-tappable { display: block; transition: box-shadow .2s, transform .1s; }
.card-tappable:active { transform: scale(.99); }

/* ---------- official header (public pages) ---------- */
.gov-topbar {
  background: var(--navy-900); color: #C8D6F2;
  font-size: 12.5px; padding: 7px 0;
}
.gov-topbar .container { display: flex; align-items: center; gap: 8px; }
.public-header {
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-700) 100%);
  color: #fff; padding: 14px 0;
}
.public-header .container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 19px; }
.brand img { width: 38px; height: 38px; }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(212,167,44,.25), transparent 60%),
    linear-gradient(160deg, var(--navy-800) 0%, var(--navy-900) 90%);
  color: #fff; padding: 44px 0 54px; text-align: center;
}
.hero h1 { font-size: clamp(28px, 7vw, 40px); font-weight: 800; letter-spacing: -.5px; }
.hero p.sub { font-size: 17px; color: #C8D6F2; max-width: 480px; margin: 0 auto 26px; }
.hero .free-badge {
  display: inline-block; background: var(--gold-100); color: #7A5E10;
  border: 1px solid #E7CE83; font-weight: 700; font-size: 14px;
  padding: 7px 16px; border-radius: 999px; margin-bottom: 18px;
}

/* ---------- trust bar ---------- */
.trust-bar { background: var(--navy-100); padding: 18px 0; }
.trust-bar .container { display: grid; gap: 10px; }
.trust-item { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--navy-900); }
.trust-item .ti-icon {
  flex: 0 0 34px; height: 34px; border-radius: 10px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); font-size: 17px;
}

/* ---------- language picker ---------- */
.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.lang-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.28);
  color: #fff; border-radius: 14px; padding: 12px 6px; font-weight: 700; font-size: 15px;
  transition: background .15s;
}
.lang-chip:hover, .lang-chip.active { background: rgba(255,255,255,.22); border-color: var(--gold-500); }
.lang-chip .flag { font-size: 22px; }
.lang-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-inline a {
  padding: 8px 14px; border-radius: 999px; background: #fff;
  border: 1.5px solid var(--navy-100); font-weight: 600; font-size: 14px;
}
.lang-inline a.active { border-color: var(--navy-800); background: var(--navy-100); }

/* ---------- feature grid ---------- */
.features { padding: 34px 0; }
.features h2, .how h2 { text-align: center; font-size: 24px; }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.feature {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 14px; text-align: center;
}
.feature .f-icon {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 16px;
  background: linear-gradient(135deg, var(--navy-100), #fff);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  border: 1px solid var(--navy-100);
}
.feature h3 { font-size: 15.5px; }
.feature p { font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- how it works ---------- */
.how { background: #fff; padding: 34px 0; }
.how-steps { counter-reset: step; display: grid; gap: 14px; margin-top: 18px; }
.how-step { display: flex; gap: 14px; align-items: flex-start; }
.how-step::before {
  counter-increment: step; content: counter(step);
  flex: 0 0 40px; height: 40px; border-radius: 50%;
  background: var(--navy-800); color: #fff; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.how-step p { margin: 8px 0 0; font-weight: 600; }

/* ---------- price strip ---------- */
.price-strip {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: #fff; text-align: center; padding: 34px 0;
}
.price-strip .price-line { font-size: 20px; font-weight: 800; margin-bottom: 16px; }

/* ---------- footer ---------- */
.public-footer { background: var(--navy-900); color: #9FB2D9; font-size: 13px; padding: 26px 0 90px; }
.public-footer a { color: #C8D6F2; }
.footer-legal { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

/* ---------- forms ---------- */
.form-page { padding: 30px 0 60px; }
label.field-label { display: block; font-weight: 700; font-size: 15px; margin: 16px 0 6px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
input[type=text], input[type=tel], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px;
  border: 1.5px solid #CBD6EC; border-radius: 12px;
  font: 500 17px var(--font); color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(11, 61, 145, .15);
}
.otp-input { letter-spacing: 10px; text-align: center; font-size: 26px !important; font-weight: 800; }

/* ---------- app (logged-in) layout ---------- */
.app-page { padding: 0 0 92px; }
.app-header {
  background: linear-gradient(160deg, var(--navy-800), var(--navy-900));
  color: #fff; padding: 22px 0 56px; border-radius: 0 0 28px 28px;
}
.app-header .container { display: flex; justify-content: space-between; align-items: center; }
.app-header h1 { font-size: 22px; margin: 0; }
.app-header .sub { color: #C8D6F2; font-size: 14px; margin: 4px 0 0; }
.pull-up { margin-top: -34px; }

/* status card */
.status-card { display: flex; align-items: center; gap: 14px; }
.status-dot { flex: 0 0 14px; height: 14px; border-radius: 50%; }
.status-trial .status-dot { background: var(--gold-500); }
.status-active .status-dot { background: var(--ok); }
.status-past_due .status-dot, .status-cancelled .status-dot { background: var(--danger); }
.status-card .st-text { font-weight: 700; font-size: 15.5px; }

/* quick actions */
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qa {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 12px; text-align: center; font-weight: 700; font-size: 14.5px;
  color: var(--ink); display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.qa .qa-icon { font-size: 30px; }

/* alert chips on home */
.chips { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.chip {
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px;
}
.chip.warn { border-inline-start: 4px solid var(--warn); }
.chip.info { border-inline-start: 4px solid var(--navy-700); }
.chip.ok { border-inline-start: 4px solid var(--ok); }
.chip.critical { border-inline-start: 4px solid var(--danger); }
.btn-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--navy-700); text-decoration: underline; font-size: 14px; font-weight: 600;
}
.clockbar {
  position: fixed; bottom: 64px; inset-inline: 0; text-align: center;
  font-size: 11px; color: var(--muted); padding: 3px 0; pointer-events: none;
  background: linear-gradient(to top, rgba(243,246,252,.95), rgba(243,246,252,0));
  z-index: 5;
}

/* ---------- list rows (rights, benefits) ---------- */
.row-card { display: flex; gap: 14px; align-items: center; }
.row-icon {
  flex: 0 0 50px; height: 50px; border-radius: 14px; font-size: 25px;
  background: var(--navy-100); display: flex; align-items: center; justify-content: center;
}
.row-body { flex: 1; min-width: 0; }
.row-body h3 { font-size: 16px; margin: 0 0 2px; }
.row-body p { font-size: 13.5px; color: var(--muted); margin: 0; }
.row-cta { color: var(--navy-800); font-weight: 800; font-size: 20px; }

/* benefit badge */
.badge {
  display: inline-block; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px;
}
.badge-gold { background: var(--gold-100); color: #7A5E10; border: 1px solid #E7CE83; }
.badge-soon { background: #EEF1F8; color: var(--muted); }
.badge-ok { background: #E2F4E8; color: var(--ok); }
.badge-warn { background: #FBECD9; color: var(--warn); }
.badge-danger { background: #FBE3DF; color: var(--danger); }

/* ---------- article ---------- */
.article-body { font-size: 16.5px; }
.article-body p { margin: 0 0 1em; white-space: pre-line; }
.disclaimer {
  background: var(--gold-100); border: 1px solid #E7CE83; color: #6B5310;
  font-size: 13px; border-radius: 12px; padding: 12px 14px; margin-top: 18px;
}

/* ---------- referral ---------- */
.link-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--navy-100); border-radius: 12px; padding: 10px 12px;
  font-weight: 700; font-size: 14px; word-break: break-all;
}
.big-number { font-size: 40px; font-weight: 800; color: var(--navy-800); text-align: center; }

/* ---------- chat ---------- */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 210px); }
.chat-log { flex: 1; overflow-y: auto; padding: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 12px 14px; border-radius: 16px; font-size: 15.5px; }
.msg-user { align-self: flex-end; background: var(--navy-800); color: #fff; border-end-end-radius: 4px; }
.msg-bot { align-self: flex-start; background: #fff; box-shadow: var(--shadow); border-end-start-radius: 4px; white-space: pre-line; }
[dir=rtl] .msg-user { align-self: flex-start; }
[dir=rtl] .msg-bot { align-self: flex-end; }
.chat-input { display: flex; gap: 8px; padding: 10px 0; }
.chat-input input { flex: 1; }
.typing { color: var(--muted); font-size: 13px; padding: 4px 2px; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 50;
  background: #fff; border-top: 1px solid #E2E8F4;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(7,31,77,.07);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 700; color: var(--muted);
  padding: 4px 10px; border-radius: 10px; min-width: 56px;
}
.bottom-nav a.active { color: var(--navy-800); background: var(--navy-100); }
.bn-icon { font-size: 21px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 14px; inset-inline: 14px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy-900); color: #fff; border-radius: 12px; padding: 13px 16px;
  font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
}
.toast-error { background: var(--danger); }
.toast-ok { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- admin ---------- */
.admin-body { background: #EEF1F8; }
.admin-shell { max-width: 1080px; margin: 0 auto; padding: 0 20px 60px; }
.admin-top {
  background: var(--navy-900); color: #fff; padding: 14px 0; margin-bottom: 24px;
}
.admin-top .admin-shell { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-nav a { color: #C8D6F2; padding: 7px 13px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.admin-nav a.active, .admin-nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.metric { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px; }
.metric .m-num { font-size: 30px; font-weight: 800; color: var(--navy-800); }
.metric .m-label { font-size: 13px; color: var(--muted); font-weight: 600; }
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
table.data th { background: var(--navy-100); text-align: start; font-size: 13px; padding: 10px 12px; color: var(--navy-900); }
table.data td { padding: 10px 12px; border-top: 1px solid #EEF1F8; font-size: 14px; }
table.data tr:hover td { background: #F7F9FD; }
.admin-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

/* ---------- misc ---------- */
.center { text-align: center; }
.mt { margin-top: 18px; }
.mb0 { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-title { font-size: 18px; font-weight: 800; margin: 22px 0 12px; }

/* ---------- AMIGO brand: flags line, pikadon flagship, tier ladder ---------- */
.flags-line { margin-top: 16px; color: #C8D6F2; font-size: 14px; font-weight: 600; }

.pikadon-banner { padding: 10px 0 26px; }
.pikadon-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: linear-gradient(135deg, #FBF3DC, #F7E7B4);
  border: 1.5px solid #E7CE83; border-radius: 20px;
  box-shadow: 0 10px 30px rgba(212, 167, 44, .25);
  padding: 22px;
}
.pikadon-card h2 { color: #6B5310; font-size: 20px; }
.pikadon-card p { color: #7A5E10; margin: 0 0 6px; font-size: 15px; }
.pikadon-card .pk-icon {
  flex: 0 0 58px; height: 58px; border-radius: 18px; font-size: 30px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.pk-note { opacity: .8; }
.math-bottom { font-weight: 800; font-size: 17px; color: var(--navy-900); margin-top: 16px; }

.tier-ladder { display: grid; gap: 10px; margin-top: 18px; }
.tier-step {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; gap: 14px; align-items: center;
}
.tier-step p { margin: 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.tier-flagship {
  border: 2px solid var(--gold-500);
  box-shadow: 0 8px 26px rgba(212, 167, 44, .3);
}
.tier-flagship p { color: #6B5310; }
.tier-badge {
  flex: 0 0 auto; font-weight: 800; font-size: 13px; letter-spacing: .5px;
  border-radius: 999px; padding: 7px 14px; min-width: 84px; text-align: center;
}
.tb-member { background: var(--navy-100); color: var(--navy-900); }
.tb-silver { background: #EDEFF3; color: #5A6B8C; border: 1px solid #C9D0DE; }
.tb-gold { background: linear-gradient(135deg, #E9C558, var(--gold-500)); color: #4A3A08; }
.tb-vip { background: linear-gradient(135deg, #2B1E5E, #4B2E83); color: #F1E8FF; }

/* tier progress (home + membership) */
.tier-progress { margin-top: 10px; }
.tier-progress .tp-bar {
  height: 10px; border-radius: 999px; background: var(--navy-100); overflow: hidden;
}
.tier-progress .tp-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--navy-700), var(--gold-500));
  transition: width .6s ease;
}
.tier-progress .tp-label { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-top: 6px; }

@media (min-width: 560px) {
  .trust-bar .container { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
  .qa-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
