/* =======================================================================
   SPYSHOP KIOSK — style.css
   Theme: "Dark Vault" — Deep intelligence, gold precision
   Portrait iPad (768 × 1024) kiosk mode
   ======================================================================= */

/* ── @property: enables smooth conic gradient border animation ────────── */
@property --angle-1 {
  syntax: "<angle>";
  inherits: false;
  initial-value: -75deg;
}

@property --angle-2 {
  syntax: "<angle>";
  inherits: false;
  initial-value: -45deg;
}

/* ── DESIGN TOKENS ────────────────────────────────────────────────────── */
:root {
  --navy:          #0D1B3E;
  --gold:          #C9A84C;
  --gold-bright:   #E8C96B;
  --gold-border:   rgba(201, 168, 76, 0.42);
  --gold-glow:     rgba(201, 168, 76, 0.14);
  --gold-glass:    rgba(201, 168, 76, 0.07);
  --text-primary:  #FFFFFF;
  --text-muted:    rgba(255, 255, 255, 0.50);
  --text-faint:    rgba(255, 255, 255, 0.28);
  --surface:       rgba(255, 255, 255, 0.055);
  --surface-press: rgba(201, 168, 76, 0.08);
  --red:           #EF4444;
  --radius-card:   18px;
  --radius-icon:   14px;
  --font:          -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                   'SF Pro Text', system-ui, sans-serif;
  /* Button animation timing */
  --btn-time:      400ms;
  --btn-ease:      cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── RESET ────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
}

body {
  font-family: var(--font);
  background-color: var(--navy);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  position: relative;
}

/* ── BACKGROUND: ambient glow layers ─────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 72% 58% at -4%   -4%,   rgba(201,168,76,0.09) 0%, transparent 55%),
    radial-gradient(ellipse 68% 55% at 104%  104%,  rgba(201,168,76,0.06) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 50%   110%,  rgba(8,14,32,0.95)    0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ── BACKGROUND: cross / plus grid texture ───────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      to right,
      transparent,
      transparent 31px,
      rgba(201,168,76,0.052) 31px,
      rgba(201,168,76,0.052) 32px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 31px,
      rgba(201,168,76,0.052) 31px,
      rgba(201,168,76,0.052) 32px
    );
  pointer-events: none;
  z-index: 0;
}

/* ── SCREEN SYSTEM ────────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: opacity;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ── HEADER ───────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 32px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 2;
  /* margin-top: 1rem; */
}

.header-logo {
    height: 25px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: .8;
}

.header-clock {
  font-size: 14px;
  font-weight: 600;
  color: rgb(13 27 62 / 44%);
  letter-spacing: 0.005em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ── HOME SCREEN ──────────────────────────────────────────────────────── */
#screen-home {
  /* inherits flex-direction: column from .screen */
}

.home-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
  overflow: hidden;
  min-height: 0;
  max-width: 80vw;
  margin: 0 auto;
}

.home-title {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--gold-bright);
  padding: 40px 0 10px;
  flex-shrink: 0;
}

.home-subtitle {
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 4px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* ── BUTTON GRID ──────────────────────────────────────────────────────── */
.btn-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 35px;
  flex: 1;
  align-content: center;
  min-height: 0;
}

/* ── BUTTON WRAPPER — shadow host ────────────────────────────────────── */
.button-wrap {
  position: relative;
  display: block;
  pointer-events: none;
}

/* Gold drop-shadow layer (blurred, sits behind the button) */
.button-shadow {
  --cutoff: 2rem;
  position: absolute;
  width:  calc(100% + var(--cutoff));
  height: calc(100% + var(--cutoff));
  top:  calc(0% - var(--cutoff) / 2);
  left: calc(0% - var(--cutoff) / 2);
  filter: blur(4px);
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.button-shadow::after {
  content: "";
  position: absolute;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(201, 168, 76, 0.14),
    rgba(201, 168, 76, 0.04)
  );
  width:  calc(100% - var(--cutoff) - 4px);
  height: calc(100% - var(--cutoff) - 4px);
  top:  calc(var(--cutoff) / 2 + 6px);
  left: calc(var(--cutoff) / 2);
  padding: 1.5px;
  box-sizing: border-box;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask-composite: exclude;
}

/* ── DEPARTMENT BUTTON — Animated Gold Conic Border ─────────────────── */
.btn-dept {
  --border-width: 1.5px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  border-radius: 16px;
  border: none;                        /* border rendered via ::after */
  background: radial-gradient(
    ellipse at 50% 25%,
    #141e42 0%,
    #09102a 55%,
    #060c1e 100%
  );
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(201, 168, 76, 0.10),
    inset 0 0 48px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  text-align: left;
  min-height: 90px;
  position: relative;
  overflow: visible;                   /* ::after bleeds outside safely */
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  pointer-events: auto;
  transition:
    transform    var(--btn-time) var(--btn-ease),
    box-shadow   var(--btn-time) var(--btn-ease);
}

/* Light sweep — travels across surface on press */
.btn-dept::before {
  content: '';
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(
    var(--angle-2),
    rgba(255, 255, 255, 0)    0%,
    rgba(255, 255, 255, 0.07) 40% 50%,
    rgba(255, 255, 255, 0)    55%
  );
  mix-blend-mode: screen;
  pointer-events: none;
  background-size: 200% 200%;
  background-position: 0% 50%;
  clip-path: inset(0 round 16px);
  transition:
    background-position calc(var(--btn-time) * 1.25) var(--btn-ease),
    --angle-2            calc(var(--btn-time) * 1.25) var(--btn-ease);
}

/* Gold conic gradient border — two bright arcs rotate on interaction */
.btn-dept::after {
  content: '';
  position: absolute;
  z-index: 1;
  border-radius: 16px;
  width:  calc(100% + var(--border-width) * 2);
  height: calc(100% + var(--border-width) * 2);
  top:  calc(0% - var(--border-width));
  left: calc(0% - var(--border-width));
  padding: var(--border-width);
  box-sizing: border-box;
  background:
    conic-gradient(
      from var(--angle-1) at 50% 50%,
      rgba(201, 168, 76, 0.95),
      rgba(201, 168, 76, 0.00)  8% 42%,
      rgba(232, 201, 107, 1.00) 50%,
      rgba(201, 168, 76, 0.00)  58% 92%,
      rgba(201, 168, 76, 0.95)
    ),
    linear-gradient(180deg,
      rgba(201, 168, 76, 0.30),
      rgba(201, 168, 76, 0.15)
    );
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask-composite: exclude;
  transition:
    all       var(--btn-time) var(--btn-ease),
    --angle-1 500ms ease;
}

.btn-dept:active,
.btn-dept.pressed {
  transform: scale(0.968);
  box-shadow:
    0 2px 8px   rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(201, 168, 76, 0.18),
    inset 0 0 60px rgba(0, 0, 0, 0.45);
}

.btn-dept:active::before,
.btn-dept.pressed::before {
  background-position: 50% 15%;
  --angle-2: -15deg;
}

.btn-dept:active::after,
.btn-dept.pressed::after {
  --angle-1: -75deg;
}

.btn-dept.disabled {
  opacity: 0.38;
  pointer-events: none;
}

.btn-dept.loading .btn-label {
  opacity: 0.40;
}

/* ── ICON CONTAINER ───────────────────────────────────────────────────── */
.btn-icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.btn-svg {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter:
    drop-shadow(0 2px 10px rgba(0, 0, 0, 0.65))
    drop-shadow(0 0 20px rgba(201, 168, 76, 0.18));
}

/* Spinner */
.btn-spinner {
  display: none;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(201, 168, 76, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.72s linear infinite;
}

.btn-dept.loading .btn-spinner { display: block; }
.btn-dept.loading .btn-svg     { display: none;  }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── BUTTON TEXT ──────────────────────────────────────────────────────── */
.btn-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.btn-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.02em;
  line-height: 1.2;
  transition: opacity 0.2s ease;
}

.btn-sublabel {
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.45;
  letter-spacing: 0.01em;
}

/* ── FOOTER ───────────────────────────────────────────────────────────── */
.home-footer {
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-faint);
  padding: 14px 20px 24px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

/* ── CONFIRMATION SCREEN ──────────────────────────────────────────────── */
#screen-confirmation {
  align-items: center;
  justify-content: center;
}

.confirm-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 36px;
  width: 100%;
  position: relative;
}

/* Expanding concentric rings — gold sonar pulse */
.confirm-rings-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
}

.confirm-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 76, 0.22);
  animation: ring-expand 3s cubic-bezier(0.1, 0.5, 0.5, 1) infinite;
  transform: translate(-50%, -50%) scale(0);
}

.confirm-ring--1 { width: 180px; height: 180px; animation-delay: 0s;    }
.confirm-ring--2 { width: 320px; height: 320px; animation-delay: 0.65s; }
.confirm-ring--3 { width: 490px; height: 490px; animation-delay: 1.3s;  }

@keyframes ring-expand {
  0%   { transform: translate(-50%, -50%) scale(0.05); opacity: 0.65; }
  100% { transform: translate(-50%, -50%) scale(1);    opacity: 0;    }
}

/* Checkmark circle */
.confirm-icon-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(201, 168, 76, 0.22) 0%,
    rgba(201, 168, 76, 0.04) 80%
  );
  border: 2px solid rgba(201, 168, 76, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  position: relative;
  z-index: 1;
  color: var(--gold-bright);
  box-shadow:
    0 0 0 10px rgba(201, 168, 76, 0.05),
    0 0 48px   rgba(201, 168, 76, 0.20);
  animation: pulse-halo 2.6s ease-in-out infinite;
}

.confirm-icon-wrap svg { width: 44px; height: 44px; }

@keyframes pulse-halo {
  0%, 100% {
    box-shadow:
      0 0 0 10px rgba(201, 168, 76, 0.05),
      0 0 48px   rgba(201, 168, 76, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 18px rgba(201, 168, 76, 0.02),
      0 0 70px   rgba(201, 168, 76, 0.32);
  }
}

.confirm-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.confirm-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.55;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.confirm-subtitle strong {
  display: block;
  font-size: 30px;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 4px;
}

.confirm-dept-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(201, 168, 76, 0.09);
  border: 1.5px solid rgba(201, 168, 76, 0.30);
  border-radius: 100px;
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gold-bright);
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(12px);
}

/* Progress bar */
.confirm-progress-wrap {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
  margin-bottom: 32px;
}

.confirm-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 12px;
}

.confirm-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: 100px;
  transition: width 1s linear;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.55);
}

.confirm-countdown {
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

/* Back button */
.btn-back {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 100px;
  padding: 12px 36px;
  color: rgba(255, 255, 255, 0.36);
  font-size: 14px;
  font-family: var(--font);
  letter-spacing: 0.03em;
  cursor: pointer;
  position: relative;
  z-index: 1;
  -webkit-appearance: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-back:active {
  border-color: rgba(255, 255, 255, 0.32);
  color: rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.05);
}

/* ── OFFLINE SCREEN ───────────────────────────────────────────────────── */
#screen-offline {
  align-items: center;
  justify-content: center;
}

.offline-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 36px;
  width: 100%;
}

.offline-icon-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.08);
  border: 2px solid rgba(239, 68, 68, 0.26);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  color: var(--red);
  box-shadow: 0 0 32px rgba(239, 68, 68, 0.14);
}

.offline-icon-wrap svg { width: 40px; height: 40px; }

.offline-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 12px;
}

.offline-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.55;
  margin-bottom: 30px;
}

.offline-phone {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: var(--gold-bright);
  margin-bottom: 44px;
  text-shadow: 0 0 22px rgba(201, 168, 76, 0.35);
}

.offline-reload-text {
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* ── TOAST ────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: rgba(10, 18, 44, 0.96);
  border: 1px solid rgba(201, 168, 76, 0.36);
  border-radius: 100px;
  padding: 13px 26px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--gold-bright);
  z-index: 200;
  opacity: 0;
  transition:
    opacity   0.3s ease,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(20px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
