/* =================================================================
   PunchClock — aligned with ver_erp design tokens
   ================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap");

/* ── Block zoom (pinch / double-tap) ─────────────────────────── */
html { touch-action: manipulation; }

/* ── Verdon brand tokens (mirror of erp app.css) ──────────────── */
:root {
  --verdon-green:  #009688;
  --verdon-red:    #d21d57;
  --verdon-blue:   #1c75ba;

  --green-400: #43a98b;
  --green-500: #2f8f72;
  --green-700: #1b5847;
  --red-700:   #841237;

  --neutral-0:   #ffffff;
  --neutral-25:  #fafbfc;
  --neutral-50:  #f5f7fa;
  --neutral-100: #eef1f5;
  --neutral-200: #e2e7ee;
  --neutral-300: #ccd3dd;
  --neutral-400: #a3acba;
  --neutral-500: #79828f;
  --neutral-600: #5b6470;
  --neutral-700: #404754;
  --neutral-800: #2a303b;
  --neutral-900: #181d26;

  --bg-app:     var(--neutral-50);
  --bg-surface: var(--neutral-0);
  --fg-1:       var(--neutral-900);
  --fg-2:       var(--neutral-700);
  --fg-3:       var(--neutral-500);
  --fg-4:       var(--neutral-400);
  --border-subtle:  var(--neutral-200);
  --border-default: var(--neutral-300);

  --shadow-sm: 0 1px 2px rgba(15,19,26,.06), 0 1px 3px rgba(15,19,26,.05);
  --shadow-md: 0 2px 4px rgba(15,19,26,.06), 0 6px 12px rgba(15,19,26,.06);
  --shadow-lg: 0 4px 8px rgba(15,19,26,.06), 0 16px 32px rgba(15,19,26,.08);

  --font-sans:    "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;

  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 20px;

  --strip-h: 48px;
}

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

html, body {
  background: var(--bg-app);
  color: var(--fg-1);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before { display: none !important; }

main {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 0;
  background: none;
}

/* =================================================================
   CONTEXT STRIP — replaces the old full header
   One thin bar: site name on the left, clock on the right.
   ================================================================= */
.np_strip {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--strip-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  z-index: 100;
  padding: 0 24px;
}
.np_strip_left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.np_strip_logo {
  width: 90px;
  height: 28px;
  background-image: url("https://www.myverdon.com/public/img/logotype.svg");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}
.np_strip_site {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np_strip_detail {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np_strip_clock {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}

/* =================================================================
   BODY
   ================================================================= */
.np_body {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px 48px 32px;
}

/* =================================================================
   SPA screens
   ================================================================= */
.np_app {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.np_screen {
  display: none;
  flex-direction: column;
  animation: np_screen_in 0.2s ease-out;
}
.np_screen.np_screen_active { display: flex; }
.np_screen:not([data-screen="workers"]):not([data-screen="splash"]) > :first-child {
  margin-top: 24px;
}
@keyframes np_screen_in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =================================================================
   SECTION HEAD — title left, back button right
   ================================================================= */
.np_section_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.np_section_title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--fg-1);
  margin-bottom: 2px;
  text-align: right;
}
.np_section_sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-3);
  text-align: right;
}

/* ── Back button ─────────────────────────────────────────────── */
.np_back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--fg-2);
  font-size: 18px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.np_back:hover {
  background: var(--neutral-50);
  border-color: var(--border-default);
  transform: translateY(-1px);
}
.np_back:active { transform: scale(0.97); }
.np_back svg { width: 20px; height: 20px; }

/* ── Sticky block (workers screen) ───────────────────────────── */
.np_sticky_block {
  position: sticky;
  top: var(--strip-h);
  z-index: 50;
  background: var(--bg-app);
  padding-top: 24px;
  padding-bottom: 12px;
}
.np_sticky_block .np_tags { margin-bottom: 0; }
.np_sticky_block .np_search { margin-bottom: 12px; }
.np_sticky_block .np_section_head { margin-bottom: 12px; }

/* =================================================================
   SPLASH / LOGIN card
   ================================================================= */
.np_login_wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.np_login_card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 48px 36px 40px 36px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.np_login_logo {
  width: 180px;
  height: 55px;
  background-image: url("https://www.myverdon.com/public/img/logotype.svg");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  margin-bottom: 6px;
}
.np_login_title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--fg-1);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}
.np_splash_state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.np_splash_text {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-3);
}
.np_login_error {
  color: var(--verdon-red);
  font-weight: 600;
}

/* =================================================================
   ACTION SCREEN — site/clock + big IN / OUT (no strip on this screen)
   ================================================================= */
.np_action_wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  padding: 16vh 32px 40px;
  min-height: 100vh;
}
.np_action_clock {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 800;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.5px;
  line-height: 1;
}
.np_action_site {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--fg-2);
  letter-spacing: -0.4px;
}
.np_action_row {
  display: flex;
  gap: 24px;
  width: 100%;
  max-width: 720px;
  justify-content: center;
  flex-wrap: wrap;
}
.np_action_btn {
  flex: 1;
  min-width: 260px;
  max-width: 340px;
  aspect-ratio: 1.35;
  border-radius: var(--radius-2xl);
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: 5px;
  transition: transform 0.12s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.np_action_btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent 55%);
  pointer-events: none;
}
.np_action_btn:hover  { transform: translateY(-3px); }
.np_action_btn:active { transform: scale(0.96); }
.np_action_in {
  background: linear-gradient(135deg, var(--green-400), var(--green-700));
  box-shadow: 0 12px 36px rgba(67,169,139,0.35);
}
.np_action_in:hover { box-shadow: 0 18px 44px rgba(67,169,139,0.45); }
.np_action_out {
  background: linear-gradient(135deg, var(--verdon-red), var(--red-700));
  box-shadow: 0 12px 36px rgba(210,29,87,0.30);
}
.np_action_out:hover { box-shadow: 0 18px 44px rgba(210,29,87,0.40); }

.np_action_logo {
  width: 140px;
  height: 42px;
  background-image: url("https://www.myverdon.com/public/img/logotype.svg");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.35;
  margin-top: 12px;
}

/* =================================================================
   SEARCH BAR
   ================================================================= */
.np_search {
  width: 100%;
  padding: 14px 18px 14px 48px;
  font-size: 15px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--fg-1);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2379828f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 16px center;
  background-size: 20px;
}
.np_search::placeholder { color: var(--fg-4); font-weight: 500; opacity: 1; }
.np_search:hover { border-color: var(--border-default); }
.np_search:focus {
  border-color: var(--verdon-blue);
  box-shadow: 0 0 0 3px rgba(28,117,186,.15);
}

/* =================================================================
   ZONE TAGS
   ================================================================= */
.np_tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.np_tag {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--fg-2);
  padding: 16px 28px;
  border-radius: var(--radius-lg);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  user-select: none;
  white-space: nowrap;
}
.np_tag:hover {
  border-color: var(--green-400);
  transform: translateY(-1px);
}
.np_tag:active { transform: scale(0.97); }
.np_tag.active {
  background: var(--green-400);
  border-color: var(--green-400);
  color: #fff;
  box-shadow: 0 4px 12px rgba(67,169,139,0.30);
}

.np_tag_all {
  background: var(--neutral-100);
  color: var(--fg-3);
  border-color: var(--neutral-300);
  border-style: dashed;
}
.np_tag_all:hover { background: var(--neutral-200); }
.np_tag_all.active {
  background: var(--neutral-700);
  border-color: var(--neutral-700);
  border-style: solid;
  color: #fff;
}

/* =================================================================
   WORKERS GRID
   ================================================================= */
.np_grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.np_worker {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--fg-1);
  padding: 10px 10px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  line-height: 1.15;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
}
.np_worker:hover {
  border-color: var(--green-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.np_worker:active { transform: scale(0.97); }
.np_worker.hidden { display: none; }
.np_worker_first {
  font-weight: 500;
  font-size: 15px;
  color: var(--fg-3);
  line-height: 1.1;
  text-transform: capitalize;
}
.np_worker_last {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--fg-1);
  line-height: 1.1;
  letter-spacing: -0.2px;
  text-transform: uppercase;
}

/* =================================================================
   USER BANNER (project + schedule screens)
   ================================================================= */
.np_user_banner {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--fg-1);
  text-align: center;
  padding: 12px 0 16px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border-subtle);
}

/* =================================================================
   LISTS (projects, schedules)
   ================================================================= */
.np_list { display: flex; flex-direction: column; gap: 10px; }
.np_list_btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--fg-1);
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.np_list_btn:hover {
  border-color: var(--green-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.np_list_btn:active { transform: scale(0.99); }
.np_list_btn b {
  font-weight: 600;
  color: var(--fg-2);
  background: var(--neutral-100);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  flex-shrink: 0;
  font-family: var(--font-sans);
}

/* Planned project highlight */
.np_list_btn_planned {
  border-color: var(--green-400);
  background: rgba(67,169,139,0.06);
}
.np_planned_badge {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-700);
  background: rgba(67,169,139,0.12);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* =================================================================
   PHOTO
   ================================================================= */
.np_photo_wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 560px;
  margin: 24px auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}
#np_video { width: 100%; height: 100%; object-fit: cover; }
.np_countdown {
  position: absolute;
  font-family: var(--font-display);
  font-size: 120px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0,0,0,0.7);
  display: none;
  z-index: 5;
  font-variant-numeric: tabular-nums;
}
.np_flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}
.np_flash.active { animation: np_flash_anim 0.35s ease-out; }
@keyframes np_flash_anim {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* =================================================================
   RESULT SCREEN
   ================================================================= */
.np_result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 48px 20px;
  min-height: calc(100vh - var(--strip-h) - 80px);
}
.np_result_state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}

/* Spinner */
.np_spinner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 6px solid var(--neutral-200);
  border-top-color: var(--green-400);
  animation: np_spin 0.8s linear infinite;
}
@keyframes np_spin { to { transform: rotate(360deg); } }

/* Success */
.np_result_check {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-400), var(--green-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 16px 40px rgba(67,169,139,0.30);
  animation: np_pop 0.4s cubic-bezier(0.18, 1.25, 0.6, 1);
}
.np_result_check svg { width: 60px; height: 60px; }

/* Error */
.np_result_cross {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--verdon-red), var(--red-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 16px 40px rgba(210,29,87,0.30);
  animation: np_pop 0.4s cubic-bezier(0.18, 1.25, 0.6, 1);
}
.np_result_cross svg { width: 56px; height: 56px; }

@keyframes np_pop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.np_result_title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--fg-1);
}
.np_result_title.np_result_title_err { color: var(--verdon-red); }
.np_result_sub {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-3);
  max-width: 440px;
  line-height: 1.4;
}

.np_result_actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.np_btn_retry, .np_btn_cancel {
  padding: 14px 32px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.1s, box-shadow 0.2s, background 0.15s;
}
.np_btn_retry {
  background: linear-gradient(135deg, var(--green-400), var(--green-700));
  color: #fff;
  box-shadow: 0 8px 20px rgba(67,169,139,0.30);
}
.np_btn_retry:hover  { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(67,169,139,0.40); }
.np_btn_retry:active { transform: scale(0.97); }
.np_btn_retry:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.np_btn_cancel {
  background: var(--bg-surface);
  color: var(--fg-2);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}
.np_btn_cancel:hover { background: var(--neutral-50); border-color: var(--neutral-400); }
.np_btn_cancel:active { transform: scale(0.98); }
.np_btn_cancel:disabled { opacity: 0.5; cursor: not-allowed; }

/* Empty state */
.np_empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--fg-3);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-xl);
}
.np_empty_icon {
  display: block;
  margin: 0 auto 12px;
  width: 44px;
  height: 44px;
  opacity: 0.35;
}

/* =================================================================
   RESPONSIVE  (worker grid is always 2 columns)
   ================================================================= */
@media (max-width: 800px) {
  .np_strip { padding: 0 18px; }
  .np_body { padding: 0 18px 40px 18px; }
  .np_action_site { font-size: 28px; }
  .np_action_clock { font-size: 72px; }
  .np_action_wrap { padding-top: 14vh; }
  .np_action_row { gap: 16px; }
  .np_action_btn { min-width: 180px; aspect-ratio: 1.3; letter-spacing: 4px; border-radius: var(--radius-xl); }
}

@media (max-width: 600px) {
  :root { --strip-h: 42px; }
  .np_strip_site { font-size: 13px; }
  .np_strip_detail { font-size: 12px; }
  .np_strip_clock { font-size: 16px; }
  .np_body { padding: 0 12px 36px 12px; }
  .np_worker { min-height: 96px; padding: 20px 8px; }
  .np_worker_last { font-size: 18px; }
  .np_action_site { font-size: 24px; }
  .np_action_clock { font-size: 60px; }
  .np_action_wrap { padding-top: 12vh; }
  .np_action_btn { min-width: 140px; }
  .np_list_btn { padding: 30px 20px; font-size: 18px; }
  .np_back { padding: 14px 20px 14px 16px; font-size: 16px; }
  .np_section_title { font-size: 17px; }
  .np_result_check, .np_result_cross { width: 100px; height: 100px; }
  .np_result_check svg { width: 50px; height: 50px; }
  .np_result_cross svg { width: 46px; height: 46px; }
  .np_result_title { font-size: 20px; }
  .np_spinner { width: 60px; height: 60px; border-width: 5px; }
  .np_countdown { font-size: 90px; }
  .np_login_card { padding: 36px 24px 30px 24px; }
  .np_login_logo { width: 150px; height: 45px; }
  .np_login_title { font-size: 20px; }
}

@media (max-width: 400px) {
  .np_worker { min-height: 88px; padding: 18px 6px; }
  .np_worker_last { font-size: 16px; }
  .np_list_btn { padding: 28px 16px; font-size: 16px; }
  .np_btn_retry, .np_btn_cancel { padding: 12px 24px; font-size: 14px; }
}
