/* ==========================================================================
   Service NSW gate styles
   --------------------------------------------------------------------------
   Install gate + licence gate + PIN gate. All three sit inside a single
   full-screen fixed overlay (#nsw-gate-overlay) so they float above the
   vendored Service NSW UI without disturbing its layout.

   NSW palette:
     --nsw-red:   #D7153A  (primary CTA)
     --nsw-red-d: #B01030  (active state)
     --nsw-ink:   #121212  (text)
     --nsw-ink-s: #4E5660  (secondary text)
     --nsw-line:  #E2E6EB  (hairline borders)
     --nsw-warn:  #FFB800  (demo banner)
   ========================================================================== */

#nsw-gate-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  /* Max 32-bit signed int - beats any z-index the vendored UI might set
     inline via its obfuscated JS. */
  z-index: 2147483647;
  background: #FFFFFF;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
#nsw-gate-overlay.hidden { display: none; }
#nsw-gate-overlay .screen { display: block; }
#nsw-gate-overlay .screen.hidden { display: none; }

/* =============================== INSTALL GATE =============================== */
#install-gate {
  flex: 1;
  position: relative;
  background: #FFFFFF;
  color: #121212;
  padding: calc(env(safe-area-inset-top, 0) + 28px) 24px calc(env(safe-area-inset-bottom, 0) + 24px);
  overflow-y: auto;
}
.ig-demo-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #FFF4D6;
  border: 1px solid #F2DA8E;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.4;
  color: #4A3200;
}
.ig-demo-banner-icon { flex: 0 0 auto; margin-top: 1px; color: #B57900; }
.ig-demo-banner-text strong { font-weight: 700; color: #4A3200; margin-right: 4px; }

.ig-wrap {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.ig-hero { text-align: center; margin-bottom: 28px; }
.ig-logo {
  display: block;
  margin: 8px auto 18px;
  width: 180px;
  height: auto;
  max-width: 60%;
}
.ig-sub {
  font-size: 15px;
  color: #4E5660;
  margin: 0;
  line-height: 1.4;
}

.ig-steps { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 16px; }
.ig-step {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #F6F7F9;
  border-radius: 12px;
  padding: 14px 16px;
}
.ig-step-num {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #D7153A;
  color: #FFFFFF;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ig-step-text { font-size: 15px; line-height: 1.4; color: #121212; }
.ig-step-text strong { font-weight: 600; }
.ig-inline-icon { display: inline-flex; vertical-align: -5px; margin: 0 2px; }
.ig-arrow {
  position: absolute;
  right: 22px;
  bottom: calc(env(safe-area-inset-bottom, 0) + 14px);
  color: #22B14C;
  animation: ig-bounce 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ig-bounce {
  0%, 100% { transform: translateY(0);   opacity: 0.55; }
  50%      { transform: translateY(8px); opacity: 1;    }
}

/* =============================== LICENCE GATE =============================== */
#license-gate {
  flex: 1;
  background: #FFFFFF;
  color: #121212;
  padding: calc(env(safe-area-inset-top, 0) + 32px) 24px calc(env(safe-area-inset-bottom, 0) + 32px);
  overflow-y: auto;
}
.lg-wrap { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; align-items: stretch; }
.lg-logo-wrap { display: flex; justify-content: center; margin-bottom: 22px; }
.lg-logo {
  display: block;
  width: 200px;
  height: auto;
  max-width: 70%;
}
.lg-title {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 26px; font-weight: 700; color: #121212;
  text-align: center; margin: 0 0 6px; letter-spacing: -0.3px;
}
.lg-sub {
  text-align: center; color: #4E5660; font-size: 14px; line-height: 1.45;
  margin: 0 0 24px;
}
.lg-step { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lg-step.hidden { display: none; }

.lg-google-btn-wrap { display: flex; justify-content: center; min-height: 40px; }
.lg-native-google-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #FFFFFF; color: #121212;
  border: 1px solid #DADCE0; border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; font-weight: 500;
  padding: 10px 24px; min-width: 240px; justify-content: center;
  cursor: pointer;
}
.lg-native-google-btn:active { background: #F6F7F9; }
.lg-native-google-btn:disabled { opacity: 0.5; cursor: default; }
.lg-native-google-btn svg { flex-shrink: 0; }

.lg-helper { font-size: 12px; color: #6B7380; text-align: center; margin: 4px 0 0; line-height: 1.4; padding: 0 12px; }

.lg-account-pill {
  display: flex; align-items: center; gap: 10px;
  background: #F6F7F9; border-radius: 999px;
  padding: 8px 10px 8px 14px;
  margin-bottom: 16px; width: 100%; max-width: 360px;
}
.lg-account-icon { flex-shrink: 0; }
.lg-account-email {
  flex: 1;
  font-size: 14px; font-weight: 500; color: #121212;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lg-account-change {
  flex: 0 0 auto;
  background: #FFFFFF; border: 1px solid #DADCE0; border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px; font-weight: 600; color: #121212;
  cursor: pointer;
}
.lg-account-change:active { background: #EEF1F3; }

.lg-key-label {
  align-self: flex-start;
  font-size: 13px; font-weight: 600; color: #4E5660;
  margin: 4px 0 6px;
}
.lg-key-input {
  width: 100%;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 15px; letter-spacing: 1px; color: #121212;
  background: #FFFFFF;
  border: 1.5px solid #DADCE0; border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}
.lg-key-input:focus { border-color: #D7153A; }
.lg-key-input::placeholder { color: #9AA0A6; letter-spacing: 1px; }

.lg-activate-btn {
  width: 100%;
  background: #D7153A; color: #FFFFFF;
  border: none; border-radius: 10px;
  padding: 13px 16px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
}
.lg-activate-btn:active   { background: #B01030; }
.lg-activate-btn:disabled { background: #D7153A; opacity: 0.5; cursor: default; }

.lg-status {
  min-height: 20px; margin-top: 10px; text-align: center;
  font-size: 13px; line-height: 1.4;
}
.lg-status-error { color: #D7153A; font-weight: 600; }
.lg-status-ok    { color: #108043; font-weight: 600; }
.lg-status-busy  { color: #4E5660; }

/* --- reset-device panel --- */
.lg-reset { margin-top: 18px; }
.lg-reset.hidden { display: none; }
.lg-reset-divider { height: 1px; background: #E2E6EB; margin-bottom: 14px; }
.lg-reset-head { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; color: #121212; }
.lg-reset-icon { flex: 0 0 auto; color: #D7153A; }
.lg-reset-title { line-height: 1.3; }
.lg-reset-text { font-size: 13px; line-height: 1.5; color: #4E5660; margin: 8px 0 12px; }
.lg-reset-text strong { color: #121212; font-weight: 600; }

.lg-reset-btn {
  width: 100%;
  background: #FFFFFF; color: #D7153A;
  border: 1.5px solid #D7153A; border-radius: 10px;
  padding: 11px 16px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
}
.lg-reset-btn:active   { background: #FFE8EC; }
.lg-reset-btn:disabled { opacity: 0.45; cursor: default; }

.lg-reset-cooldown {
  margin-top: 10px;
  background: #FFF4D6; border: 1px solid #F2DA8E; border-radius: 10px;
  padding: 10px 12px;
}
.lg-reset-cooldown.hidden { display: none; }
.lg-reset-cooldown-head {
  display: flex; gap: 6px; align-items: center;
  font-size: 13px; font-weight: 600; color: #4A3200;
}
.lg-reset-cooldown-text { font-size: 12px; color: #4A3200; margin: 4px 0 0; line-height: 1.4; }
.lg-reset-cooldown-text strong { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
.lg-reset-help { font-size: 12px; color: #6B7380; margin: 6px 0 0; }
.lg-reset-footnote { font-size: 11px; color: #9AA0A6; margin: 10px 0 0; text-align: center; }

/* =========================================================================
   GLOBAL: no text selection, no double-tap zoom, no touch callout.
   -------------------------------------------------------------------------
   The vendored UI is meant to feel like a native app - letting the user
   highlight text, double-tap to zoom, or get the iOS selection callout
   on long-press breaks the illusion. touch-action: manipulation disables
   the 300ms tap delay + double-tap zoom gesture. user-select: none kills
   the selection highlight. Admin inputs override user-select back to text
   below so the form stays usable.
   ========================================================================= */
html, body {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  touch-action: manipulation;
}
#admin-overlay input,
#admin-overlay textarea,
#admin-overlay select,
#lg-key-input,
#lg-account-email {
  -webkit-user-select: text !important;
  user-select: text !important;
}

/* Nothing to do for the sticky footer now - the pink and white hairline
   that were burnt into IMG_4619.PNG have been repainted dark at the
   pixel level (see logos/IMG_4619.PNG.bak for the original). */

/* =========================================================================
   KILL THE VENDORED INLINE-EDIT MODE
   -------------------------------------------------------------------------
   The HTTrack mirror shipped with a "tap any field to edit it inline"
   mode (blue 'Editing - tap a field' banner, dashed outlines, dotted
   'Click to customise' avatar circle, etc). We're replacing that with a
   hidden admin menu reachable via Profile -> Help and support -> secret
   tap sequence. So nuke every surface of the inline flow here.
   ========================================================================= */
.edit-flag,
.screen.edit-on .edit-flag {
  display: none !important;
}
.lic-edit-hit,
.fd-buy-edit,
[data-action="toggleEdit"] {
  pointer-events: none !important;
  display: none !important;
}
.lic-edit-text,
.cust,
.pd-value {
  -webkit-user-modify: read-only !important;
  user-select: none !important;
  cursor: default !important;
}
.lic-edit-text[contenteditable="true"],
.cust[contenteditable="true"],
.pd-value[contenteditable="true"] {
  outline: none !important;
}
.cust-img, .cust[data-cust="avatar"] {
  /* The 'Click to customise' avatar placeholder - make it look static. */
  border-style: solid !important;
  color: transparent !important;
}
.cust-img::after, .cust[data-cust="avatar"]::after {
  content: "";
}

/* =========================================================================
   ADMIN OVERLAY (hidden by default; opened via 5-tap on Help and support)
   ========================================================================= */
#admin-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: #1E1E22;
  display: flex;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
#admin-overlay.hidden { display: none; }
.admin-card {
  width: 100%;
  height: 100%;
  background: #1E1E22; color: #F2F2F7;
  border-radius: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0) + 14px) 16px 14px;
  border-bottom: 1px solid #2A2A2E;
}
.admin-title { font-size: 17px; font-weight: 700; }
.admin-close {
  background: none; border: none; color: #F2F2F7;
  font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.admin-body {
  padding: 12px 16px 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-field { display: flex; flex-direction: column; margin-bottom: 14px; }
.admin-field label {
  font-size: 12px; font-weight: 600; color: #9AA0A6;
  text-transform: uppercase; letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.admin-field input,
.admin-field select,
.admin-field textarea {
  background: #2A2A2E; color: #F2F2F7;
  border: 1px solid #3A3A3E; border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus { border-color: #D7153A; }
.admin-field textarea { resize: vertical; min-height: 60px; }
.admin-foot {
  display: flex; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid #2A2A2E;
}
.admin-btn {
  flex: 1;
  padding: 11px 14px;
  border-radius: 10px;
  border: none;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.admin-btn.primary   { background: #D7153A; color: #FFFFFF; }
.admin-btn.primary:active { background: #B01030; }
.admin-btn.secondary { background: #2A2A2E; color: #F2F2F7; }
.admin-btn.secondary:active { background: #3A3A3E; }
.admin-btn.danger    { background: transparent; color: #FF6B6B; }
