/* ==========================================================================
   YES MOTOR — Proof of income upload (/income)
   Tokens mirror styles.css :root so this page reads as part of the main
   website: slate primary, red YESMOTORS wordmark, 8px spacing scale,
   12px cards, Inter, Material Symbols Outlined. Built for one thumb on a
   phone: every target is at least 44px, every input is 18px (no iOS zoom).
   ========================================================================== */

:root {
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --accent: #d90429;
  --success: #16a34a;
  --success-hover: #15803d;
  --success-soft: #f0fdf4;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --blue-wash: #eff6ff;
  --danger: #dc2626;
  --danger-ink: #991b1b;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;
  --whatsapp: #25d366;
  --radius-card: 12px;
  --radius-ui: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-card: 0 1px 2px rgb(15 23 42 / 0.04), 0 6px 20px rgb(15 23 42 / 0.05);
  --s-4: 4px; --s-8: 8px; --s-12: 12px; --s-16: 16px;
  --s-20: 20px; --s-24: 24px; --s-32: 32px; --s-40: 40px;
  --s-48: 48px; --s-64: 64px;
  --header-height: 64px;
  --motion-fast: 100ms;
  --motion-base: 160ms;
  --motion-slow: 220ms;
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid rgb(37 99 235 / 0.35); outline-offset: 2px; }

.poi-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;
}

/* Material Symbols: hidden until the icon font is in, so a slow network
   never shows "photo_camera" as words. Labels carry the meaning anyway. */
.material-symbols-outlined {
  width: 1em;
  height: 1em;
  overflow: hidden;
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
  visibility: hidden;
  user-select: none;
}
.icons-ready .material-symbols-outlined { visibility: visible; }

/* ---- Header (same wordmark and flag switch as the inventory) ---------- */

.poi-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.poi-header-inner {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--s-16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-12);
}

.poi-brand {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  line-height: 0;
  border-radius: var(--radius-ui);
  text-decoration: none;
  transition: opacity var(--motion-fast) ease, transform var(--motion-fast) var(--ease-premium);
}
.poi-brand:hover { opacity: 0.88; }
.poi-brand:active { transform: scale(0.98); }

.poi-brand-svg {
  display: block;
  height: 24px;
  width: auto;
  overflow: visible;
  text-rendering: geometricPrecision;
}

.poi-brand-text {
  fill: currentColor;
  font-family: "Inter", "Arial Black", Arial, Helvetica, sans-serif;
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.07em;
}

.poi-lang {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 36px;
  padding: 3px;
  background: #f4f6fa;
  border-radius: 999px;
}

.poi-lang-btn {
  width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  opacity: 0.42;
  transition: opacity 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}
.poi-lang-btn:hover { opacity: 0.75; }
.poi-lang-btn[aria-pressed="true"] {
  opacity: 1;
  background: #fff;
  box-shadow: 0 1px 3px rgb(16 37 79 / 0.16);
}

.poi-flag {
  width: 22px;
  height: 16px;
  overflow: hidden;
  border: 1px solid rgb(7 27 79 / 0.13);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgb(7 27 79 / 0.08);
}

/* ---- Layout ----------------------------------------------------------- */

.poi-main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--s-24) var(--s-16) var(--s-48);
  padding-bottom: max(var(--s-48), env(safe-area-inset-bottom));
}

.poi-hero { text-align: center; padding: var(--s-8) var(--s-8) var(--s-16); }

.poi-hero-icon {
  width: 64px;
  height: 64px;
  display: inline-grid;
  place-items: center;
  margin-bottom: var(--s-12);
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 18px;
}
.poi-hero-icon .material-symbols-outlined { font-size: 36px; }

.poi-hero h1 {
  margin: 0;
  font-size: clamp(25px, 7vw, 32px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.poi-hero p {
  margin: var(--s-8) 0 0;
  color: var(--text-sub);
  font-size: 17px;
  line-height: 1.45;
  text-wrap: balance;
}

.poi-hero .poi-hero-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--s-12);
  padding: 6px 12px 6px 10px;
  color: var(--success-hover);
  background: var(--success-soft);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
.poi-hero-time .material-symbols-outlined { font-size: 18px; }

.poi-application-notice {
  margin-bottom: var(--s-16);
  padding: var(--s-16);
  color: #166534;
  background: var(--success-soft);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-card);
  font-size: 15px;
  line-height: 1.45;
}
.poi-application-notice p { margin: 0; }
.poi-application-notice p + p { margin-top: var(--s-4); font-weight: 700; }

/* ---- Documents card ---------------------------------------------------- */

.poi-step {
  margin-top: var(--s-8);
  padding: var(--s-16);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--motion-base) ease, box-shadow var(--motion-base) ease;
}

.poi-step.is-next {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 4px rgb(37 99 235 / 0.06), var(--shadow-card);
}

.poi-docs-guidance {
  margin: 0 0 var(--s-8);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}
.poi-docs-limits {
  margin: 0 0 var(--s-16);
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.45;
}

.poi-field-error {
  margin: var(--s-8) 0 0;
  display: flex;
  align-items: flex-start;
  gap: var(--s-8);
  color: var(--danger);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}
.poi-field-error:empty { display: none; }

/* Pressing Send with nothing added shakes the card once. */
.poi-step.is-flagging { animation: step-flag 420ms var(--ease-premium); border-color: var(--danger); }
@keyframes step-flag {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ---- Document pickers ------------------------------------------------- */

.poi-pickers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-12);
}

.poi-tile {
  position: relative;
  min-height: 136px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  padding: var(--s-16) var(--s-12);
  text-align: center;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-card);
  cursor: pointer;
  user-select: none;
  transition: transform var(--motion-fast) var(--ease-premium), border-color var(--motion-base) ease, background-color var(--motion-base) ease, box-shadow var(--motion-base) ease;
}
.poi-tile:active { transform: scale(0.97); }
.poi-tile:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgb(37 99 235 / 0.15); }

@media (hover: hover) {
  .poi-tile:hover { border-color: var(--blue); background: var(--blue-wash); }
}

/* The real input stays focusable for keyboards and screen readers. */
.poi-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.poi-tile-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: var(--s-4);
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 50%;
  transition: transform var(--motion-base) var(--ease-premium);
}
.poi-tile-icon .material-symbols-outlined { font-size: 30px; }
.poi-tile-text { display: contents; }
.poi-tile-title { font-size: 17px; font-weight: 800; line-height: 1.2; color: var(--text-main); }
.poi-tile-hint { font-size: 13px; line-height: 1.35; color: var(--text-sub); }

.poi-step.is-flagging .poi-tile { border-color: var(--danger); }

/* Mouse and trackpad: no camera to open, so one wide drop target. */
@media (hover: hover) and (pointer: fine) {
  .poi-pickers { grid-template-columns: 1fr; }
  .poi-tile--camera { display: none; }
  .poi-tile--files {
    min-height: 104px;
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--s-16);
    padding: var(--s-16) var(--s-20);
    text-align: left;
    border-style: dashed;
  }
  .poi-tile--files .poi-tile-icon { margin-bottom: 0; }
  .poi-tile--files .poi-tile-text { display: flex; flex-direction: column; gap: var(--s-4); }
}

.is-dragging .poi-tile--files {
  border-style: dashed;
  border-color: var(--blue);
  background: var(--blue-wash);
  box-shadow: 0 0 0 4px rgb(37 99 235 / 0.12);
}
.is-dragging .poi-tile--files .poi-tile-icon { transform: scale(1.08); }

/* ---- Document list ---------------------------------------------------- */

.poi-docs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-8);
}
.poi-docs:not(:empty) { margin-top: var(--s-16); }

.poi-doc {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 44px;
  align-items: center;
  gap: var(--s-12);
  padding: var(--s-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  animation: doc-in var(--motion-slow) var(--ease-premium) both;
  transition: opacity var(--motion-base) ease, transform var(--motion-base) ease, border-color var(--motion-base) ease;
}
.poi-doc.is-leaving { opacity: 0; transform: scale(0.97); }
.poi-doc.is-error { border-color: var(--danger-line); background: var(--danger-soft); }
.poi-doc.is-sent { border-color: #bbf7d0; background: var(--success-soft); }

@keyframes doc-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.poi-doc-thumb {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--blue);
  background: var(--surface-soft);
  border-radius: var(--radius-ui);
}
.poi-doc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poi-doc-thumb .material-symbols-outlined { font-size: 30px; }
.poi-doc.is-pdf .poi-doc-thumb { color: var(--danger); background: var(--danger-soft); }
.poi-doc.is-error .poi-doc-thumb { color: var(--danger); background: #fff; }

.poi-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--blue-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.poi-doc-text { min-width: 0; display: grid; gap: 2px; }
.poi-doc-name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.poi-doc-meta { font-size: 13px; line-height: 1.35; color: var(--text-sub); }
.poi-doc.is-error .poi-doc-meta { color: var(--danger-ink); font-weight: 600; }
.poi-doc.is-sent .poi-doc-meta { color: var(--success-hover); font-weight: 700; }

.poi-doc-remove {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--text-sub);
  background: transparent;
  border: 0;
  border-radius: 50%;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-premium);
}
.poi-doc-remove:hover { color: var(--danger); background: var(--danger-soft); }
.poi-doc-remove:active { transform: scale(0.92); }
.poi-doc-remove .material-symbols-outlined { font-size: 24px; }
.poi-doc-done { width: 44px; height: 44px; display: grid; place-items: center; color: var(--success); }

.poi-count {
  margin: var(--s-12) 0 0;
  display: flex;
  align-items: center;
  gap: var(--s-8);
  color: var(--success-hover);
  font-size: 15px;
  font-weight: 800;
}
.poi-count .material-symbols-outlined { font-size: 20px; }

/* ---- Send ------------------------------------------------------------- */

.poi-submit { margin-top: var(--s-20); }

.poi-submit-error {
  margin: 0 0 var(--s-12);
  display: flex;
  align-items: flex-start;
  gap: var(--s-8);
  padding: var(--s-12) var(--s-16);
  color: var(--danger-ink);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-card);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  animation: doc-in var(--motion-slow) var(--ease-premium) both;
}
.poi-submit-error .material-symbols-outlined { color: var(--danger); margin-top: 1px; }

.poi-send {
  position: relative;
  width: 100%;
  min-height: 60px;
  display: block;
  padding: 0 var(--s-16);
  overflow: hidden;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.18);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: background-color var(--motion-slow) ease, box-shadow var(--motion-slow) ease, transform var(--motion-fast) var(--ease-premium);
}
.poi-send:hover { background: var(--primary-hover); }
.poi-send:active { transform: translateY(1px) scale(0.995); }

/* Everything is filled in: the button turns green and breathes. */
.poi-send.is-ready { background: var(--success); box-shadow: 0 8px 22px rgb(22 163 74 / 0.32); animation: ready-glow 2.2s ease-in-out infinite; }
.poi-send.is-ready:hover { background: var(--success-hover); }
@keyframes ready-glow {
  0%, 100% { box-shadow: 0 8px 22px rgb(22 163 74 / 0.28); }
  50% { box-shadow: 0 8px 30px rgb(22 163 74 / 0.5); }
}

.poi-send.is-sending { cursor: progress; background: var(--success); animation: none; }
.poi-send-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgb(255 255 255 / 0.2);
  transition: width 240ms ease;
}
.poi-send-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-8);
  min-height: 60px;
  font-variant-numeric: tabular-nums;
}
.poi-send-label .material-symbols-outlined { font-size: 22px; }

.poi-secure {
  margin: var(--s-12) var(--s-8) 0;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}
.poi-secure > .material-symbols-outlined {
  display: inline-block;
  margin-right: 4px;
  font-size: 16px;
  vertical-align: -3px;
  color: var(--success);
}
.poi-secure a { color: var(--text-sub); font-weight: 600; white-space: nowrap; }

/* ---- Success / offline ------------------------------------------------ */

.poi-card {
  padding: var(--s-40) var(--s-24);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  outline: 0;
}

.poi-success { animation: doc-in 320ms var(--ease-premium) both; }

.poi-success-icon {
  width: 88px;
  height: 88px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 12px 28px rgb(22 163 74 / 0.28);
  animation: success-pop 520ms var(--ease-premium) both;
}
.poi-success-icon .material-symbols-outlined { font-size: 52px; font-variation-settings: "FILL" 1; }
@keyframes success-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.poi-card h2 {
  margin: var(--s-20) 0 var(--s-8);
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.poi-success-body, .poi-offline p {
  margin: 0;
  color: var(--text-sub);
  font-size: 17px;
  line-height: 1.5;
}

.poi-ref {
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  margin: var(--s-20) 0 var(--s-24);
  padding: var(--s-8) var(--s-12);
  color: var(--text-sub);
  background: var(--surface-soft);
  border-radius: var(--radius-ui);
  font-size: 14px;
}
.poi-ref strong {
  color: var(--text-main);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.poi-secondary {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-8);
  padding: 0 var(--s-16);
  color: var(--text-main);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-card);
  font-size: 17px;
  font-weight: 800;
  transition: border-color var(--motion-base) ease, background-color var(--motion-base) ease, transform var(--motion-fast) var(--ease-premium);
}
.poi-secondary:hover { border-color: var(--blue); background: var(--blue-wash); }
.poi-secondary:active { transform: scale(0.98); }
.poi-secondary .material-symbols-outlined { color: var(--blue); }

.poi-text-link {
  display: inline-block;
  margin-top: var(--s-16);
  padding: var(--s-8);
  color: var(--text-sub);
  font-size: 15px;
  font-weight: 700;
}

.poi-offline-icon {
  width: 72px;
  height: 72px;
  display: inline-grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 50%;
}
.poi-offline-icon .material-symbols-outlined { font-size: 38px; }

/* ---- Help ------------------------------------------------------------- */

.poi-help { margin-top: var(--s-32); text-align: center; }
.poi-help p { margin: 0 0 var(--s-12); color: var(--text-sub); font-size: 15px; font-weight: 600; }
.poi-help-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s-8); }

.poi-pill {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  padding: 0 var(--s-20);
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--motion-fast) var(--ease-premium), opacity var(--motion-fast) ease;
}
.poi-pill:active { transform: scale(0.97); }
.poi-pill .material-symbols-outlined { font-size: 20px; color: var(--blue); }
.poi-pill--whatsapp { color: #fff; background: var(--whatsapp); border-color: transparent; }
.poi-pill--whatsapp .material-symbols-outlined { color: #fff; }
.poi-pill--whatsapp:hover { opacity: 0.92; }

@media (max-width: 359px) {
  .poi-main { padding-inline: var(--s-12); }
  .poi-header-inner { padding-inline: var(--s-12); }
  .poi-brand-svg { height: 20px; }
  .poi-lang-btn { width: 30px; }
  .poi-step { padding: var(--s-12); }
  .poi-pickers { gap: var(--s-8); }
  .poi-tile { padding-inline: var(--s-8); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
