/* ============================================================
   LG Smart Home Quest — Mobile-First Styles
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  min-height: 100dvh;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: #f0ebe0;
  overflow-x: hidden;
}

/* ── Screen Container ─────────────────────────────────────── */
.screen {
  width: 100%;          /* fill full device width — no side gaps */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: clamp(13px, 3.8vw, 16px);
}

.screen-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 5vw, 28px) clamp(16px, 5vw, 28px) clamp(24px, 6vw, 36px);
}

/* ── Logo ─────────────────────────────────────────────────── */
.logo-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 0 8px;
}

.logo-main {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.logo-small {
  height: 34px;
  width: auto;
  object-fit: contain;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
}

.btn-red {
  background: #C8001E;
  color: #fff;
}

.btn-red:active:not([disabled]) {
  background: #a30018;
  transform: scale(0.98);
}

.btn-red[disabled],
.btn-red[ng-disabled="true"],
button[disabled].btn-red {
  background: #c0c0c0;
  color: #888;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: #999;
  border: 1.5px solid #ddd;
  margin-top: 10px;
}

.btn-ghost:active {
  background: #f0f0f0;
}

.btn-block { width: 100%; }


/* ══════════════════════════════════════════════════════════
   SCREEN 1 — HOME
══════════════════════════════════════════════════════════ */
.home-screen {
  background: #f0ebe0;
  justify-content: flex-start;
  gap: 0;
}

.home-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  text-align: center;
}

.welcome-sub {
  font-size: 12px;
  letter-spacing: 2px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
}

.home-brand {
  font-size: 52px;
  font-weight: 900;
  color: #C8001E;
  line-height: 1;
  margin-top: -4px;
}

.home-title {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: 0.5px;
  margin-top: -8px;
}

.home-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.65;
  max-width: 300px;
}

.terms-btn {
  display: block;
  width: 100%;
  background: #e8e2d8;
  border: 1px solid #d5cdc2;
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 13px;
  color: #555;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.terms-btn:active {
  background: #ddd5c8;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  cursor: pointer;
  padding: 2px 0;
}

.consent-check {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 1px;
  accent-color: #C8001E;
  cursor: pointer;
}

.consent-text {
  font-size: 13px;
  color: #444;
  line-height: 1.45;
  text-align: left;
}


/* ══════════════════════════════════════════════════════════
   SCREEN 2 — REGISTRATION
══════════════════════════════════════════════════════════ */
.register-screen {
  background: #fff;
  gap: 0;
}

.reg-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}

.reg-title {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a1a;
  text-align: center;
}

.reg-sub {
  font-size: 13px;
  color: #aaa;
  text-align: center;
  margin-top: -10px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.field-input {
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  color: #1a1a1a;
  background: #fafafa;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, background 0.2s;
}

.field-input:focus {
  border-color: #C8001E;
  background: #fff;
}

.error-text {
  font-size: 13px;
  color: #C8001E;
  background: #fff0f2;
  border: 1px solid #ffccd4;
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
}


/* ══════════════════════════════════════════════════════════
   SCREEN 3 — QUIZ
══════════════════════════════════════════════════════════ */
.quiz-screen {
  background: #fff;
  padding: 0;
  gap: 0;
}

/* Header */
.quiz-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #f2f2f2;
  background: #fff;
}

/* Hint Card */
.hint-card {
  margin: 14px 14px 0;
  background: #f8f8f8;
  border-radius: 14px;
  padding: 20px 18px;
  text-align: center;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: background 0.3s, border 0.3s;
  border: 2px solid transparent;
}

.hint-card.hint-flash-correct {
  background: #edf7ee;
  border-color: #4CAF50;
}

.hint-card.hint-flash-wrong {
  background: #fdecea;
  border-color: #C8001E;
}

.hint-quote {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.55;
  font-style: italic;
}

.hint-cta {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 800;
  color: #C8001E;
  margin-top: 10px;
  font-style: normal;
  letter-spacing: 0.3px;
}

/* Timer */
.timer-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0 8px;
}

.timer-val {
  font-size: 40px;
  font-weight: 900;
  color: #C8001E;
  font-family: 'Courier New', 'Lucida Console', monospace;
  letter-spacing: 1px;
  transition: transform 0.2s;
}

.timer-val.timer-danger {
  animation: timerPulse 0.6s infinite;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1);    color: #C8001E; }
  50%       { transform: scale(1.06); color: #ff2244; }
}

/* Scanner Box — square, fills card width, centred */
.scanner-box {
  position: relative;
  margin: 0 14px;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  /* square: height = width of the box */
  aspect-ratio: 1 / 1;
  max-height: 52vh;     /* never taller than half the screen */
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* html5-qrcode overrides */
#qr-reader {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}

#qr-reader__dashboard { display: none !important; }
#qr-reader__status_span { display: none !important; }
#qr-reader__header_message { display: none !important; }
#qr-reader__dashboard_section_swaplink { display: none !important; }

/* Scan feedback overlay */
.scan-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.scan-icon {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  color: #fff;
  animation: iconPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.scan-icon-ok  { background: #4CAF50; }
.scan-icon-err { background: #C8001E; }

@keyframes iconPop {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* Progress Squares */
.progress-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 14px 0 10px;
}

.prog-sq {
  width: 46px;
  height: 12px;
  border-radius: 4px;
  background: #e4e4e4;
  border: 1.5px solid #d0d0d0;
  transition: background 0.35s, border-color 0.35s, transform 0.35s, box-shadow 0.35s;
}

.sq-ok {
  background: #4CAF50;
  border-color: #3d9941;
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.45);
}

.sq-err {
  background: #C8001E;
  border-color: #a30018;
}

.sq-current {
  border-color: #C8001E;
  background: #fff;
  animation: sqPulse 1.1s ease-in-out infinite;
}

@keyframes sqPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 0, 30, 0.3); }
  50%       { box-shadow: 0 0 0 4px rgba(200, 0, 30, 0.15); }
}

/* Footer */
.quiz-footer {
  font-size: 11.5px;
  color: #888;
  text-align: center;
  padding: 0 14px 16px;
  line-height: 1.55;
}


/* ══════════════════════════════════════════════════════════
   SCREEN 4 — RESULT
══════════════════════════════════════════════════════════ */
.result-screen {
  background: #f0ebe0;
}

.result-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding-top: 12px;
}

.result-trophy {
  font-size: 64px;
  line-height: 1;
}

.result-heading {
  font-size: 28px;
  font-weight: 900;
  color: #1a1a1a;
}

.score-block {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.score-big {
  font-size: 76px;
  font-weight: 900;
  color: #C8001E;
  line-height: 1;
}

.score-slash,
.score-of {
  font-size: 40px;
  color: #bbb;
  font-weight: 300;
}

.result-msg {
  font-size: 15px;
  color: #555;
  line-height: 1.65;
  max-width: 290px;
  padding: 0 8px;
}

.result-squares {
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════
   LOADING SCREEN (between questions)
══════════════════════════════════════════════════════════ */
.loading-screen {
  background: #fff;
  justify-content: center;
  align-items: center;
  gap: 0;
}

.loading-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid #f0e0e3;
  border-top-color: #C8001E;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

.loading-text {
  font-size: clamp(16px, 4.5vw, 20px);
  font-weight: 700;
  color: #555;
  letter-spacing: 0.3px;
}

/* ══════════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════════ */
[ng\:cloak], [ng-cloak], .ng-cloak {
  display: none !important;
}
