/* ==========================================================================
   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;
  z-index: 100000;
  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, 'Segoe UI', Roboto, 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, 'Segoe UI', Roboto, 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; }

/* =============================== PIN GATE =============================== */
#pin-screen {
  flex: 1;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0) + 60px) 24px calc(env(safe-area-inset-bottom, 0) + 40px);
}
#pin-screen.hidden { display: none; }
.pin-wrap {
  width: 100%; max-width: 460px;
  display: flex; flex-direction: column; align-items: center;
  flex: 1;
}
.pin-lock {
  width: 72px; height: 72px;
  border-radius: 18px;
  background: #D7153A;
  color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  margin: 10px 0 28px;
}
.pin-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: clamp(17px, 5vw, 22px);
  font-weight: 700;
  color: #121212;
  margin: 0 0 32px;
  text-align: center;
  line-height: 1.2;
  padding: 0 16px;
}
.pin-dots {
  display: flex; justify-content: space-between;
  width: 100%; max-width: 300px;
  margin-bottom: 32px;
}
.pin-dots .dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid #121212;
  background: transparent;
  transition: background 0.12s ease;
}
.pin-dots .dot.filled { background: #121212; }
.pin-error {
  min-height: 20px; color: #D7153A;
  font-size: 13px; font-weight: 600; margin-bottom: 12px;
}
.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  width: 100%; max-width: 340px;
  row-gap: 28px; column-gap: 40px;
  margin-top: auto;
}
.key {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 24px; font-weight: 500;
  color: #121212;
  height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  border: none; background: transparent;
  cursor: pointer;
  transition: background 0.1s ease, transform 0.05s ease;
}
.key:active { background: #F0F2F5; transform: scale(0.96); }
.key-forgot { font-size: 14px; font-weight: 600; color: #D7153A; }
.key-back { font-size: 18px; }
