/* PostMaker customer app. Mobile first; the same pages widen nicely on a laptop. */

:root {
  --ink: #17163A;
  --ink-2: #3B3A5C;
  --muted: #5B5B78;
  --on-ink-muted: #C9C8E0;
  --ground: #F3F4F9;
  --surface: #FFFFFF;
  --line: #E4E5EF;
  --line-strong: #D5D6E4;
  --accent: #C2410C;
  --accent-dark: #9A3412;
  --accent-bright: #F97316;
  --accent-soft: #FFF1E8;
  --wa: #0E7A3E;
  --wa-dark: #0B6332;
  --ok-soft: #E6F4EC;
  --ok-ink: #0B5E30;
  --danger-soft: #FDECEC;
  --danger-ink: #A61B1B;
  --radius: 14px;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --display: 'Sora', 'Plus Jakarta Sans', system-ui, sans-serif;
}

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

/* "hidden" always hides, even on elements that have their own display (flex, grid) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

button, input { font: inherit; }

:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Brand ---------- */

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; background: var(--accent-bright);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-mark-img { object-fit: contain; background: #FFFFFF; padding: 3px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.3px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 22px; border-radius: var(--radius);
  font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: background .15s, transform .1s, box-shadow .15s;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-dark); color: #FFFFFF; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: #F7F7FB; color: var(--ink); }
.btn-wa { background: var(--wa); color: #FFFFFF; }
.btn-wa:hover { background: var(--wa-dark); color: #FFFFFF; }
.btn-wa-outline { background: var(--surface); color: var(--wa); border-color: var(--wa); }
.btn-wa-outline:hover { background: #F2FAF5; color: var(--wa-dark); }
.btn-ghost { background: transparent; color: var(--muted); height: 48px; }
.btn-ghost:hover { color: var(--ink); }
.btn[disabled] { opacity: .7; cursor: wait; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink); flex-shrink: 0;
}
.icon-btn:hover { background: #F7F7FB; }

/* ---------- Login ---------- */

.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.auth-hero {
  background: var(--ink); color: #FFFFFF;
  padding: calc(48px + env(safe-area-inset-top)) 28px 76px;
  border-radius: 0 0 32px 32px;
  display: flex; flex-direction: column; gap: 28px;
}
.auth-hero h1 {
  margin: 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(26px, 7.6vw, 34px); line-height: 1.2; letter-spacing: -0.5px;
}
.auth-hero p { margin: 10px 0 0; font-size: 15px; color: var(--on-ink-muted); }

.auth-card {
  margin: -44px 20px 0; background: var(--surface); border-radius: 24px;
  padding: 26px 22px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 12px 32px rgba(23, 22, 58, .10);
}

.auth-bottom {
  margin-top: auto; padding: 28px 20px calc(30px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.auth-bottom span { font-size: 14px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input-box {
  display: flex; align-items: center; height: 54px; border-radius: var(--radius);
  border: 1.5px solid var(--line-strong); background: var(--surface); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.input-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(23, 22, 58, .08); }
.input-box.is-invalid { border-color: var(--danger-ink); }
.input-prefix {
  padding: 0 12px 0 16px; height: 100%; display: flex; align-items: center;
  font-weight: 700; border-right: 1px solid var(--line);
}
.input-box input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent;
  padding: 0 16px; font-size: 17px; color: var(--ink);
}
.input-box input::placeholder { color: #8A8AA3; }
.input-box .icon-btn { border: 0; background: transparent; width: 52px; height: 52px; border-radius: 0; color: var(--muted); }

.check {
  display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer;
}
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.check-title { display: block; font-size: 15px; font-weight: 600; }
.check-sub { display: block; font-size: 13px; color: var(--muted); }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.45; font-weight: 500;
}
.notice svg { flex-shrink: 0; margin-top: 1px; }
.notice-error { background: var(--danger-soft); color: var(--danger-ink); }
.notice-ok { background: var(--ok-soft); color: var(--ok-ink); }

/* ---------- App pages ---------- */

.app {
  max-width: 560px; margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px; min-height: 100vh; min-height: 100dvh;
}

.topbar { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--accent-bright); display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 14px; overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.topbar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar-hello { font-size: 13px; color: var(--muted); }
.topbar-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: 52px; z-index: 10; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(23, 22, 58, .16); padding: 8px; display: none;
}
.menu.open .menu-panel { display: block; }
.menu-panel form { margin: 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 12px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-decoration: none;
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--ground); color: var(--ink); }
.menu-item-danger { color: var(--danger-ink); }
.menu-item-danger:hover { color: var(--danger-ink); }

.form-card {
  background: var(--surface); border-radius: 24px; padding: 24px 20px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 12px 32px rgba(23, 22, 58, .08);
}
.form-hint { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.form-card-title { display: flex; align-items: center; gap: 12px; }
.form-card-title h2 { margin: 0; font-family: var(--display); font-size: 20px; letter-spacing: -0.3px; }
.form-card-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* My payments */
.pay-total {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ground); border-radius: 16px; padding: 14px 16px;
}
.pay-total > div { display: flex; flex-direction: column; }
.pay-total-label { font-size: 13px; color: var(--muted); }
.pay-total-amount { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.3px; }
.pay-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line);
}
.pay-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.pay-icon-cash { background: var(--ok-soft); color: var(--ok-ink); }
.pay-icon-online { background: #E7EEFF; color: #2847B8; }
.pay-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pay-date { font-weight: 700; font-size: 15px; }
.pay-mode { font-size: 13px; color: var(--muted); }
.pay-receipt { font-size: 13px; font-weight: 700; text-decoration: none; margin-top: 2px; }
.pay-amount { font-weight: 700; font-size: 16px; white-space: nowrap; }
.pay-empty { margin: 0; padding: 18px 0 4px; text-align: center; color: var(--muted); font-size: 15px; }

/* Password boxes drawn as dots: plain text boxes, so phones never suggest a password */
.masked { -webkit-text-security: disc; text-security: disc; }
.masked::placeholder { -webkit-text-security: none; }

.eyebrow { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.page-date { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.4px; }

.empty-card {
  flex: 1; background: var(--surface); border-radius: 24px; border: 1.5px dashed var(--line-strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 32px 26px; text-align: center; min-height: 340px;
}
.empty-icon {
  width: 92px; height: 92px; border-radius: 28px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
}
.empty-card h2 { margin: 0; font-family: var(--display); font-size: 22px; line-height: 1.3; letter-spacing: -0.3px; }
.empty-card p { margin: 0; font-size: 15px; color: var(--muted); max-width: 320px; }

.date-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.chip-ok { background: var(--ok-soft); color: var(--ok-ink); }
.chip-warn { background: var(--accent-soft); color: var(--accent-dark); }
.chip-danger { background: var(--danger-soft); color: var(--danger-ink); }
.chip-muted { background: #ECEDF4; color: var(--ink-2); }

/* Plan expired / account under review / category paused */
.blocker-card {
  background: var(--surface); border-radius: 24px; padding: 32px 22px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  box-shadow: 0 12px 32px rgba(23, 22, 58, .08);
}
.blocker-icon {
  width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.blocker-expired .blocker-icon { background: var(--danger-soft); color: var(--danger-ink); }
.blocker-pending .blocker-icon { background: #ECEDF4; color: var(--ink); }
.blocker-card h2 { margin: 4px 0 0; font-family: var(--display); font-size: 22px; line-height: 1.3; letter-spacing: -0.3px; }
.blocker-card p { margin: 0 0 8px; font-size: 15px; color: var(--muted); max-width: 320px; }

/* Plan validity: calm normally, orange with a Renew button in the last days */
.plan-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 14px;
}
.plan-card-warn { background: var(--accent-soft); border-color: #F6C8A8; }
.plan-row { display: flex; align-items: center; gap: 12px; }
.plan-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ground); color: var(--ink);
}
.plan-card-warn .plan-icon { background: #FFFFFF; color: var(--accent); }
.plan-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.plan-title { font-weight: 700; font-size: 16px; }
.plan-sub { font-size: 13px; color: var(--muted); }
.plan-card-warn .plan-sub { color: var(--ink-2); }
.plan-days {
  font-size: 13px; font-weight: 700; color: var(--ok-ink); background: var(--ok-soft);
  padding: 6px 10px; border-radius: 999px; white-space: nowrap;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Today's post */
.post { display: flex; flex-direction: column; gap: 14px; }
.post-card {
  margin: 0; border-radius: 20px; overflow: hidden; background: #E9EAF2;
  box-shadow: 0 14px 34px rgba(23, 22, 58, .16);
}
.post-card img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; }
.post-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.note {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
  font-size: 13px; line-height: 1.45; color: var(--ink-2);
}
.note svg { color: var(--accent); flex-shrink: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 32px);
  background: var(--ink); color: #FFFFFF; padding: 13px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(23, 22, 58, .3);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Install the app (bottom sheet) ---------- */

.install-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(13, 12, 36, .55);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .2s ease;
}
.install-backdrop[hidden] { display: none; }
.install-backdrop.show { opacity: 1; }

.install-sheet {
  width: 100%; max-width: 560px; background: var(--surface); color: var(--ink);
  border-radius: 28px 28px 0 0; padding: 12px 22px calc(26px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 -10px 40px rgba(13, 12, 36, .25);
  transform: translateY(24px); transition: transform .2s ease;
}
.install-backdrop.show .install-sheet { transform: translateY(0); }
.install-grabber { width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); align-self: center; }

.install-head { display: flex; align-items: center; gap: 16px; }
.install-icon { width: 64px; height: 64px; border-radius: 18px; flex-shrink: 0; }
.install-head h2 { margin: 0; font-family: var(--display); font-size: 20px; letter-spacing: -0.3px; }
.install-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

.install-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.install-points li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.install-points svg { color: var(--ok-ink); flex-shrink: 0; }

.install-ios {
  margin: 0; padding: 14px 16px 14px 34px; background: var(--ground); border-radius: 14px;
  display: flex; flex-direction: column; gap: 8px; font-size: 15px;
}
.install-ios svg { vertical-align: -4px; color: var(--accent); }

@media (min-width: 768px) {
  .install-backdrop { align-items: center; }
  .install-sheet { border-radius: 24px; max-width: 440px; }
}

/* Laptop and bigger: the login becomes a centred card */
@media (min-width: 768px) {
  .auth { align-items: center; justify-content: center; padding: 40px 20px; }
  .auth-shell { width: 100%; max-width: 440px; border-radius: 28px; overflow: hidden; background: var(--ground); box-shadow: 0 24px 60px rgba(23, 22, 58, .14); }
  .auth-hero { padding-top: 44px; }
  .auth-bottom { margin-top: 0; }
}
@media (max-width: 767.98px) {
  .auth-shell { display: flex; flex-direction: column; flex: 1; }
}

/* ---------- Privacy Policy / Terms & Conditions ---------- */

.legal-links {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px;
  font-size: 13px; color: var(--muted); padding: 4px 0;
}
.legal-links a { color: var(--ink-2); font-weight: 600; text-decoration: none; padding: 6px 2px; }
.legal-links a:hover, .legal-links a:focus-visible { color: var(--accent); text-decoration: underline; }
.auth-bottom .legal-links { margin-top: 4px; }

.policy-top { display: flex; align-items: center; gap: 12px; }
.policy-back { color: var(--ink); text-decoration: none; }
.policy-brand-mark { width: 36px; height: 36px; border-radius: 11px; }
.policy-brand-name { font-size: 18px; color: var(--ink); }
.policy-title { margin: 4px 0 0; font-family: var(--display); font-size: 26px; line-height: 1.25; letter-spacing: -0.4px; color: var(--ink); }
.policy-updated { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.policy-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 20px; box-shadow: 0 1px 2px rgba(23, 22, 58, .04);
}
.policy-empty { margin: 0; color: var(--muted); line-height: 1.6; }
.policy-content { font-size: 15px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.policy-content > :first-child { margin-top: 0; }
.policy-content > :last-child { margin-bottom: 0; }
.policy-content p { margin: 0 0 14px; }
.policy-content h2, .policy-content h3, .policy-content h4 {
  font-family: var(--display); color: var(--ink); line-height: 1.3; letter-spacing: -0.2px; margin: 26px 0 10px;
}
.policy-content h2 { font-size: 20px; }
.policy-content h3 { font-size: 17px; }
.policy-content h4 { font-size: 15px; }
.policy-content ul, .policy-content ol { margin: 0 0 14px; padding-left: 22px; }
.policy-content li { margin-bottom: 6px; }
.policy-content a { color: var(--accent); font-weight: 600; }
.policy-content strong, .policy-content b { color: var(--ink); }
.policy-content blockquote {
  margin: 0 0 14px; padding: 10px 14px; border-left: 4px solid var(--accent-bright);
  background: var(--accent-soft); border-radius: 0 10px 10px 0;
}
.policy-content hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.policy-content figure { margin: 0 0 14px; overflow-x: auto; }
.policy-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.policy-content th, .policy-content td { border: 1px solid var(--line-strong); padding: 8px 10px; text-align: left; vertical-align: top; }
.policy-content th { background: var(--ground); color: var(--ink); }

@media (min-width: 640px) {
  .policy-card { padding: 30px 32px; }
  .policy-title { font-size: 30px; }
}
