/* Petromix · Field check-in (rep) and the open-app reminder
   Scoped under .ci. Full screen on a phone, a centred panel on a laptop.
   Built from the supplied prototype's README (its .jsx was not sent); the
   colours are the app's supplied-card palette, with a light theme. */

.ci {
  --ci-acc: #FFC20E;
  --ci-ink: #121417;
  --ci-card: #17191C;
  --ci-raised: #1E2125;
  --ci-line: rgba(255,255,255,.08);
  --ci-line-2: rgba(255,255,255,.14);
  --ci-text: #FFFFFF;
  --ci-text-2: #B9C0C7;
  --ci-muted: #8F98A2;
  --ci-ok: #7EE0A8; --ci-ok-bg: rgba(47,179,107,.14);
  --ci-warn: #F5A524; --ci-warn-bg: rgba(245,165,36,.14);
  --ci-bad: #FF8A80; --ci-bad-bg: rgba(240,68,56,.14);
  --ci-font: "Barlow", "Inter", system-ui, sans-serif;

  position: fixed; inset: 0; z-index: 9000;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(8,9,10,.72);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  color: var(--ci-text);
  font-family: var(--ci-font);
  font-size: 16px; line-height: normal; letter-spacing: normal; text-align: start;
  -webkit-font-smoothing: antialiased;
}
.ci *, .ci *::before, .ci *::after { box-sizing: border-box; }
.ci h2, .ci h3, .ci p { margin: 0; color: inherit; letter-spacing: normal; }
:where(.ci) :where(button, select, input) { font-family: inherit; }
.ci :focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
html.ci-open { overflow: hidden; }

.ci-panel {
  width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--ci-card); border: 1px solid var(--ci-line); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.ci-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 12px; background: var(--ci-card); border-bottom: 1px solid var(--ci-line); }
.ci-head-ic { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: rgba(255,194,14,.12); color: var(--ci-acc); }
.ci-head h2 { font-size: 18px; font-weight: 800; line-height: 1.15; }
.ci-head p { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--ci-muted); }
.ci-x { margin-inline-start: auto; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--ci-line-2); background: transparent; color: var(--ci-text); display: grid; place-items: center; cursor: pointer; }
.ci-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 12px; }

/* viewfinder + face guide */
.ci-view { position: relative; aspect-ratio: 3 / 4; max-height: 46dvh; width: 100%; margin: 0 auto; border-radius: 16px; overflow: hidden; background: radial-gradient(120% 80% at 50% 30%, #2A2E33, #101214); }
.ci-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.ci-video[hidden] { display: none; }
.ci-sim { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.22); }
.ci-guide { position: absolute; left: 50%; top: 46%; width: 58%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%); border-radius: 50%; border: 3px dashed rgba(255,194,14,.85); box-shadow: 0 0 0 999px rgba(0,0,0,.28); }
.ci-cam { position: absolute; left: 10px; top: 10px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(0,0,0,.55); color: #FFFFFF; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.ci-cam i { width: 7px; height: 7px; border-radius: 50%; background: #F04438; box-shadow: 0 0 0 3px rgba(240,68,56,.3); }

/* site picker */
.ci-field { display: flex; flex-direction: column; gap: 6px; }
.ci-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ci-muted); }
.ci-select, .ci-input { width: 100%; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--ci-line-2); background: var(--ci-raised); color: var(--ci-text); font-size: 15px; font-weight: 600; }
.ci-select option { background: var(--ci-card); color: var(--ci-text); }

/* live checks */
.ci-checks { display: grid; gap: 8px; }
.ci-check, .ci-step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ci-line); background: var(--ci-raised); }
.ci-check-ic { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: var(--ci-muted); }
.ci-check-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ci-text-2); }
.ci-check-t b { font-size: 14px; font-weight: 800; color: var(--ci-text); }
.ci-check.is-ok .ci-check-ic, .ci-step.is-done .ci-check-ic { background: var(--ci-ok-bg); color: var(--ci-ok); }
.ci-check.is-warn .ci-check-ic { background: var(--ci-warn-bg); color: var(--ci-warn); }
.ci-check.is-bad .ci-check-ic, .ci-step.is-bad .ci-check-ic { background: var(--ci-bad-bg); color: var(--ci-bad); }
.ci-check.is-wait .ci-check-ic svg, .ci-step.is-run .ci-check-ic svg { animation: ci-spin .9s linear infinite; }
.ci-step.is-wait { opacity: .5; }
.ci-step { font-size: 14px; font-weight: 700; }
@keyframes ci-spin { to { transform: rotate(360deg); } }
.ci-clock { font-variant-numeric: tabular-nums; color: var(--ci-text); font-weight: 800; }
.ci-mini { margin-inline-start: auto; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--ci-line-2); background: transparent; color: var(--ci-text); font-size: 13px; font-weight: 700; cursor: pointer; }

/* the big button */
.ci-go { width: 100%; min-height: 58px; padding: 0 18px; border: 0; border-radius: 16px; background: var(--ci-acc); color: var(--ci-ink); font-size: 17px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; transition: filter .15s, transform .12s; }
.ci-go:hover { filter: brightness(1.05); }
.ci-go:active { transform: scale(.98); }
.ci-go--sm { min-height: 48px; font-size: 15px; width: auto; flex: 1; }
.ci-ghost { min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--ci-line-2); background: transparent; color: var(--ci-text); font-size: 15px; font-weight: 700; cursor: pointer; }
.ci-fine { font-size: 12px; line-height: 1.45; color: var(--ci-muted); }

.ci-steps { display: grid; gap: 8px; padding: 6px 0; }

/* confirmation */
.ci-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px 0 2px; }
.ci-done-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; }
.ci-done.is-ok .ci-done-ic { background: var(--ci-ok-bg); color: var(--ci-ok); }
.ci-done.is-warn .ci-done-ic { background: var(--ci-warn-bg); color: var(--ci-warn); }
.ci-done h3 { font-size: 22px; font-weight: 800; }
.ci-done-where { font-size: 14px; color: var(--ci-text-2); }
.ci-done-where b { color: var(--ci-text); }
.ci-done-photo { width: 96px; height: 128px; object-fit: cover; border-radius: 12px; border: 2px solid var(--ci-line-2); }
.ci-reasons { margin: 0; padding: 10px 12px 10px 28px; border-radius: 12px; background: var(--ci-warn-bg); color: var(--ci-text); font-size: 13px; line-height: 1.5; text-align: start; width: 100%; }
.ci-done-acts { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; }
.ci-done-acts .ci-ghost { flex: 1; }

/* the reminder */
.ci-panel--sm { padding: 26px 20px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; width: min(380px, 100%); }
.ci-panel--sm h2 { font-size: 22px; font-weight: 800; line-height: 1.2; }
.ci-panel--sm p { font-size: 14.5px; line-height: 1.5; color: var(--ci-text-2); }
.ci-panel--sm .ci-ghost { width: 100%; }
.ci-ring { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: var(--ci-bad-bg); color: var(--ci-bad); animation: ci-ring 1.1s ease-in-out 3; }
@keyframes ci-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }

/* phone: the check-in takes the screen */
@media (max-width: 520px) {
  .ci:not(.ci--remind) { padding: 0; place-items: stretch; }
  .ci:not(.ci--remind) .ci-panel { width: 100%; max-height: none; height: 100dvh; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ci *, .ci *::before, .ci *::after { animation: none !important; transition: none !important; }
}

/* light theme */
:root[data-scheme="light"] .ci {
  --ci-card: #FFFFFF; --ci-raised: #F4F5F7;
  --ci-line: rgba(18,20,23,.09); --ci-line-2: rgba(18,20,23,.18);
  --ci-text: #121417; --ci-text-2: #3B424A; --ci-muted: #5B636D;
  --ci-ok: #17703F; --ci-ok-bg: rgba(23,112,63,.10);
  --ci-warn: #8A5A00; --ci-warn-bg: rgba(245,165,36,.16);
  --ci-bad: #B42318; --ci-bad-bg: rgba(180,35,24,.10);
  background: rgba(18,20,23,.45);
}
:root[data-scheme="light"] .ci :focus-visible { outline-color: #121417; }
:root[data-scheme="light"] .ci-head-ic { background: rgba(255,194,14,.2); color: #8A5A00; }
:root[data-scheme="light"] .ci-check-ic { background: rgba(18,20,23,.06); }
