/* =====================================================================
   Ziga Invoice · Sign-in page
   Pure CSS3. Shares design tokens with the dashboard stylesheet (ziga.css).
   Layout: split screen. Forest brand panel on the left, cream sign-in card
   on the right. Stacks to one column under 900px.
   ===================================================================== */

:root {
  /* Brand */
  --forest: #18553F;
  --deep: #0F3B2B;
  --mid: #1F6149;
  --butter: #F6D76B;
  --butter-soft: #FBEDB5;
  --coral: #F28C78;
  --coral-ink: #A8442F;
  --cream: #FFF9EF;
  --sage: #DCE9DD;
  /* Neutrals and states */
  --ink: #16261F;
  --muted: #5A6D63;
  --line: #E7DFCE;
  --line2: #F1ECE2;
  --bad: #B23A24;
  --bad-bg: #F9E0DA;
  --wa: #1FA855;
  /* Type */
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --chat: "DM Sans", system-ui, sans-serif;
  /* Shape */
  --r-lg: 24px;
  --r-md: 14px;
  --r-sm: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
a { color: var(--forest); font-weight: 700; text-decoration: none; }
a:hover { color: var(--deep); text-decoration: underline; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 10;
  background: var(--butter); color: var(--deep); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; }

/* ---------- Page layout ---------- */
.page {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

/* ---------- Brand panel ---------- */
.brandside {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 12%, rgba(246, 215, 107, .14), transparent 38%),
    var(--deep);
  color: var(--sage);
  padding: 44px clamp(28px, 5vw, 72px) 72px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--cream); font-weight: 800; font-size: 24px; letter-spacing: -.04em;
}
.logo:hover { color: var(--cream); text-decoration: none; }
.logo small { font-size: 12px; font-weight: 500; letter-spacing: 0; opacity: .75; }

.pitch { display: flex; flex-direction: column; gap: 16px; max-width: 34rem; /*margin-top: auto;*/ }
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--butter);
}
.pitch h1 {
  font-size: clamp(34px, 3.6vw, 52px); line-height: 1.04; letter-spacing: -.035em;
  color: var(--cream); font-weight: 800; text-wrap: balance;
}
.pitch h1 span { color: var(--butter); }
.lede { font-size: 17px; color: var(--sage); max-width: 30rem; }

/* WhatsApp preview */
.chat {
  margin: 0; display: flex; flex-direction: column; gap: 10px;
  max-width: 25rem; font-family: var(--chat); font-size: 14px;
}
.bubble { padding: 10px 14px; border-radius: 16px; line-height: 1.4; box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); }
.bubble.me { align-self: flex-end; max-width: 82%; background: #D9FDD3; color: #0B2A1E; border-bottom-right-radius: 4px; }
.bubble.ziga {
  align-self: flex-start; width: 88%; background: var(--cream); color: var(--ink);
  border-bottom-left-radius: 4px; display: flex; flex-direction: column; gap: 4px;
}
.bubble.ziga b { color: var(--forest); font-family: var(--sans); font-size: 13px; }
.ln { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.ln.tot { color: var(--ink); font-weight: 700; border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 2px; }
.acts { display: flex; gap: 8px; margin-top: 6px; }
.acts span {
  flex: 1; text-align: center; padding: 6px 0; border-radius: 10px;
  background: var(--sage); color: var(--forest); font-weight: 700; font-size: 13px;
}
.acts span:first-child { background: var(--forest); color: var(--cream); }

.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-weight: 600; color: var(--cream); }
.perks li { display: flex; align-items: center; gap: 10px; }
.tick {
  width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--butter);
  -webkit-mask: none;
  position: relative;
}
.tick::after {
  content: ""; position: absolute; left: 7px; top: 4px; width: 6px; height: 11px;
  border: solid var(--deep); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

/* Receipt "teeth" along the bottom edge: the Ziga mark's zig-zag motif */
.teeth {
  position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  background:
    linear-gradient(135deg, transparent 50%, var(--cream) 50%) 0 0 / 20px 14px repeat-x,
    linear-gradient(225deg, transparent 50%, var(--cream) 50%) 0 0 / 20px 14px repeat-x;
  opacity: .9;
}

/* ---------- Sign-in panel ---------- */
.formside {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 48px max(24px, env(safe-area-inset-right)) 28px max(24px, env(safe-area-inset-left));
}
.card {
  width: 100%; max-width: 440px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: 0 30px 60px -36px rgba(15, 59, 43, .35);
  display: flex; flex-direction: column; gap: 22px;
}
.logo-dark { display: none; color: var(--deep); font-size: 22px; }
.logo-dark:hover { color: var(--deep); }

.head h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; color: var(--deep); }
.head p { color: var(--muted); margin-top: 4px; }

/* Method switch (radio-driven, no JavaScript required) */
.method > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--line2); border-radius: 12px; padding: 4px; margin-bottom: 20px;
}
.seg label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 10px; border-radius: 9px; font-weight: 700; font-size: 14px;
  color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
#m-phone:checked ~ .seg label[for="m-phone"],
#m-email:checked ~ .seg label[for="m-email"] {
  background: #fff; color: var(--forest); box-shadow: 0 1px 3px rgba(15, 59, 43, .15);
}
#m-phone:focus-visible ~ .seg label[for="m-phone"],
#m-email:focus-visible ~ .seg label[for="m-email"] { outline: 3px solid var(--coral); outline-offset: 1px; }
.panel { display: none; flex-direction: column; gap: 16px; }
#m-phone:checked ~ .panel-phone,
#m-email:checked ~ .panel-email { display: flex; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .otp legend { font-size: 13px; font-weight: 700; color: var(--ink); }
.lab-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.small-link { font-size: 13px; }
input[type="email"], input[type="password"], input[type="tel"], input[type="text"] {
  width: 100%; min-width: 0; height: 48px; padding: 0 14px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-md);
  font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #9AA59F; }
input:hover { border-color: #D5CBB5; }
input:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(24, 85, 63, .14); }
input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.hint { font-size: 13px; color: var(--muted); }

.phone { display: flex; align-items: stretch; }
.cc {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1.5px solid var(--line); border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md);
  background: var(--cream); font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--ink);
}
.flag { /* Nigeria: green-white-green */
  width: 20px; height: 14px; border-radius: 2px; flex: none;
  background: linear-gradient(90deg, #008751 33.3%, #fff 33.3% 66.6%, #008751 66.6%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.phone input { border-radius: 0 var(--r-md) var(--r-md) 0; font-family: var(--mono); letter-spacing: .02em; }

.pw { position: relative; }
.pw input { padding-right: 48px; }
.reveal {
  position: absolute; right: 6px; top: 6px; width: 36px; height: 36px;
  display: grid; place-items: center; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.reveal:hover, .reveal[aria-pressed="true"] { background: var(--line2); color: var(--forest); }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--forest); margin: 0; }

/* One-time code */
.otp { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.otp legend { padding: 0; margin-bottom: 10px; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp-boxes input {
  height: 56px; padding: 0; text-align: center;
  font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--deep);
}
.otp-boxes input.filled { border-color: var(--butter); background: var(--butter-soft); }
/* With JavaScript, the code boxes appear only after the code is requested */
.js .otp { display: none; }
.js .panel-phone.sent .otp { display: flex; }
.js .panel-phone.sent > .btn-primary { display: none; }

/* Alert */
.alert {
  background: var(--bad-bg); color: var(--bad); border-radius: var(--r-sm);
  padding: 10px 12px; font-size: 14px; font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 50px; padding: 0 18px; border-radius: var(--r-md);
  font-weight: 800; font-size: 15px; cursor: pointer; border: 1.5px solid transparent;
  transition: background .15s, transform .05s, box-shadow .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--forest); color: var(--cream); }
.btn-primary:hover { background: var(--deep); color: var(--cream); }
.btn-wa { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-wa:hover { border-color: var(--wa); color: var(--ink); background: #F3FBF5; }
.btn-wa .ic { background: var(--wa); }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.new { text-align: center; color: var(--muted); font-size: 14px; }
.secure {
  display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted);
  border-top: 1px solid var(--line2); padding-top: 16px;
}
.secure .ic { width: 16px; height: 16px; margin-top: 2px; background: var(--forest); }

.foot {
  width: 100%; max-width: 440px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  font-size: 13px; color: var(--muted);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.foot a { color: var(--muted); font-weight: 600; }
.foot a:hover { color: var(--forest); }

/* ---------- Icons (inline SVG masks, no icon library) ---------- */
.ic { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ic-wa { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.3 14.1c-.2.6-1.3 1.2-1.8 1.2-.5.1-1 .2-3.3-.7-2.8-1.1-4.6-4-4.7-4.2-.1-.2-1.1-1.5-1.1-2.9s.7-2 1-2.3c.2-.3.5-.3.7-.3h.5c.2 0 .4 0 .6.5l.8 2c.1.2.1.3 0 .5l-.4.6c-.1.2-.3.3-.1.6.1.3.6 1 1.3 1.6.9.8 1.7 1.1 2 1.2.2.1.4.1.5-.1l.7-.9c.2-.2.4-.2.6-.1l1.9.9c.3.1.4.2.5.3.1.2.1.8-.1 1.4z'/></svg>"); }
.ic-mail { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2'/><path d='m3 7 9 6 9-6'/></svg>"); }
.ic-eye { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/><circle cx='12' cy='12' r='3'/></svg>"); }
.ic-eye-off { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10.6 5.1A10.9 10.9 0 0 1 12 5c6.5 0 10 7 10 7a17 17 0 0 1-2.7 3.6M6.6 6.6A17 17 0 0 0 2 12s3.5 7 10 7a10 10 0 0 0 5.4-1.6M3 3l18 18M9.9 9.9a3 3 0 0 0 4.2 4.2'/></svg>"); }
.ic-lock { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='10' width='16' height='11' rx='2'/><path d='M8 10V7a4 4 0 0 1 8 0v3'/></svg>"); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .chat { display: none; }
}
@media (max-width: 900px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .brandside { display: none; }
  .logo-dark { display: inline-flex; }
  .formside { justify-content: flex-start; padding-top: max(32px, env(safe-area-inset-top)); }
}
@media (max-width: 480px) {
  body { background: #fff; }
  .card { border: 0; box-shadow: none; padding: 8px 0; }
  .otp-boxes { gap: 6px; }
  .otp-boxes input { height: 50px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
