/**
 * setup.css - CSS cho Setup Portal pages
 * 
 * Pages: setup.ejs, setup-license.ejs, setup-unconfigured.ejs
 * 
 * Tuân thủ:
 * - TV UI Guidelines (font-size >= 18px)
 * - CSS Variables từ variables.css
 * - Focus states từ focus.css
 */

/* ========== SETUP VARIABLES ========== */
:root {
  --setup-green: #12b366;
  --setup-green-light: #62e5a4;
  --setup-green-dark: #0d8a4f;
  --setup-text: #012b16;
  --setup-border: #072b1a;
  --setup-ring: rgba(7, 43, 26, 0.25);
  --setup-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  --setup-shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.35);
}

/* ========== SETUP PAGE BASE ========== */
.setup-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--setup-text);
  position: absolute;
  top: 0;
  left: 0;
}

.setup-page--green {
  background: var(--setup-green);
}

.setup-page--gradient {
  background: linear-gradient(135deg, #06c167 0%, #05ab5c 100%);
}

/* ========== SETUP LOGO ========== */
.setup-logo {
  position: absolute;
  left: 38px;
  top: 17px;
  width: 230px;
  z-index: 10;
}

.setup-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.setup-logo--large {
  left: 60px;
  top: 40px;
  width: 580px;
  height: 120px;
  overflow: hidden;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.setup-logo--large img {
  width: auto;
  height: 130px;
  margin-left: 32px;
  transform-origin: top left;
  transform: scale(1.2) translate(-6%, -4%);
  user-select: none;
}

/* ========== CENTER BOX LAYOUT ========== */
.setup-center-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.setup-center-box__content {
  /* Natural width, không dùng flex: 1 để tránh lệch tâm */
  margin-right: 80px;
}

.setup-center-box__image {
  width: 422px;
  border-radius: 24px;
  box-shadow: var(--setup-shadow);
}

/* ========== SETUP TITLE ========== */
.setup-title {
  font-weight: 800;
  font-size: 54px;
  margin: 0 0 30px;
  color: var(--setup-text);
}

.setup-title--large {
  font-size: 40px;
  line-height: 1.1;
  color: #001524;
  margin-bottom: 0.25em;
}

/* ========== SETUP BUTTONS ========== */
.setup-btn {
  padding: 16px 34px;
  border-radius: 18px;
  background: var(--setup-green-light);
  border: none;
  font-weight: 800;
  font-size: 34px;
  box-shadow: var(--setup-shadow);
  cursor: pointer;
  outline: none;
  color: var(--setup-text);
  display: inline-block;
  margin-top: 20px;
  transition: all 0.15s ease;
}

.setup-btn:focus {
  background: #25b84c;
  color: #fff;
  box-shadow: 0 0 12px 3px rgba(25, 176, 109, 0.8);
}

.setup-btn--primary {
  background: #19b06d;
  color: #fff;
}

.setup-btn--primary:hover,
.setup-btn--primary:focus {
  background: #158f5a;
}

.setup-btn--secondary {
  margin-right: 20px;
  background: #dfeee6;
  color: var(--setup-text);
}

.setup-btn--secondary:hover,
.setup-btn--secondary:focus {
  background: #c9e0d6;
}

.setup-btn--full {
  width: 100%;
  padding: 18px 0;
  font-size: 22px;
  border-radius: 999px;
  border: 3px solid var(--setup-border);
  background: #06c167;
  color: var(--setup-border);
}

.setup-btn--full:focus {
  box-shadow: 0 0 0 6px rgba(6, 193, 103, 0.35);
  transform: scale(1.02);
}

/* ========== POPUP / OVERLAY ========== */
.setup-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
}

.setup-overlay.hidden {
  display: none;
}

.setup-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--setup-shadow-lg);
}

.setup-popup__title {
  margin: 0 0 18px;
  font-size: 32px;
  font-weight: 700;
  color: var(--setup-text);
}

/* ========== FORM FIELDS ========== */
.setup-field {
  display: flex;
  margin: 14px 0;
}

.setup-field > * {
  margin-right: 10px;
}

.setup-field > *:last-child {
  margin-right: 0;
}

.setup-input {
  flex: 1;
  font-size: 28px;
  font-weight: 700;
  margin-right: 20px;
  padding: 12px 14px;
  border: 2px solid #b7d8c7;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--setup-text);
}

.setup-input:focus {
  border-color: #19b06d;
  box-shadow: 0 0 0 3px rgba(25, 176, 109, 0.2);
}

.setup-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.setup-actions > * {
  margin-right: 10px;
}

.setup-actions > *:last-child {
  margin-right: 0;
}

.setup-btn--sm {
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 20px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s;
}

.setup-btn--sm:focus {
  box-shadow: 0 0 0 3px rgba(25, 176, 109, 0.5);
}

/* ========== RESOLUTION OPTIONS ========== */
.setup-res-options {
  display: flex;
  flex-direction: column;
  margin: 10px 0 16px;
}

.setup-res-options > * {
  margin-bottom: 10px;
}

.setup-res-options > *:last-child {
  margin-bottom: 0;
}

.setup-res-btn {
  font-size: 22px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #b7d8c7;
  background: #f9fffb;
  text-align: left;
  outline: none;
  cursor: pointer;
  transition: all 0.15s;
}

.setup-res-btn:focus {
  border-color: #19b06d;
  box-shadow: 0 0 0 3px rgba(25, 176, 109, 0.35);
}

.setup-res-btn.active {
  background: #25b84c;
  color: #fff;
  border-color: #25b84c;
}

/* ========== UNCONFIGURED PAGE ========== */
.setup-unconfigured {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 80px 0 0;
  position: relative;
}

.setup-unconfigured__art-wrap {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  height: 100%;
}

.setup-unconfigured__art {
  width: 550px;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.12));
  margin-left: -20px;
}

.setup-unconfigured__content {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 56%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.setup-unconfigured__text {
  font-size: 28px;
  line-height: 1.5;
  color: #042b1c;
  margin-bottom: 10px;
  font-weight: 500;
  max-width: 600px;
}

/* ========== CONTACT LINE ========== */
.setup-contact-line {
  display: flex;
  align-items: center;
  line-height: 1.35;
  font-size: 28px;
  color: #042b1c;
  font-weight: 500;
  margin-bottom: 10px;
}

.setup-contact-line > * {
  margin-right: 12px;
}

.setup-contact-line > *:last-child {
  margin-right: 0;
}

.setup-contact-icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-color: transparent;
}

.setup-contact-icon--tel {
  background-image: url('/images/setup/telephone.svg');
}

.setup-contact-icon--mail {
  background-image: url('/images/setup/gmail.svg');
}

/* ========== QR CODE ========== */
.setup-qr {
  position: absolute;
  right: 30px;
  bottom: 30px;
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.setup-qr__box {
  position: relative;
  width: 300px;
  height: 300px;
  overflow: hidden;
  border-radius: 8px;
}

.setup-qr__img {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  object-fit: fill;
}

/* ========== LICENSE/INFO CARD ========== */
.setup-card {
  background: #fff;
  width: 700px;
  border-radius: 24px;
  padding: 42px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -300px;
  margin-left: -350px;
}

.setup-card__title {
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 22px;
  color: #001524;
}

.setup-card__info {
  background: #f6f7f8;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 28px;
  text-align: left;
  font-size: 16px;
}

.setup-card__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.setup-card__label {
  color: #666;
}

.setup-card__value {
  font-weight: 800;
  color: #000;
}

/* ========== TOAST NOTIFICATIONS ========== */
.setup-toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 99999;
  pointer-events: none;
}

.setup-toast-wrap > * {
  margin-bottom: 10px;
}

.setup-toast-wrap > *:last-child {
  margin-bottom: 0;
}

.setup-toast {
  display: flex;
  align-items: center;
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 14px;
  font: 600 15px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #fff;
  min-width: 240px;
  max-width: 600px;
  text-align: left;
  background: rgba(20, 24, 36, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: setup-slide-in 0.18s ease-out, setup-fade-out 0.25s ease-in forwards;
  animation-delay: 0s, var(--hideDelay, 2.4s);
}

.setup-toast > * {
  margin-right: 10px;
}

.setup-toast > *:last-child {
  margin-right: 0;
}

.setup-toast__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
}

.setup-toast--ok {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.96), rgba(16, 148, 69, 0.96));
}

.setup-toast--error {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.96), rgba(185, 28, 28, 0.96));
}

.setup-toast--info {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.96), rgba(37, 99, 235, 0.96));
}

@keyframes setup-slide-in {
  from {
    transform: translate(-50%, 12px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes setup-fade-out {
  to {
    opacity: 0;
    transform: translate(-50%, 4px);
  }
}

/* ========== TV FIXED LAYOUT (1920x1080) ========== */
/* Không sử dụng responsive cho TV - kích thước cố định */

/* ========== DEV MODE BANNER ========== */
.setup-dev-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 48px;
  background: linear-gradient(90deg, #ff6b35 0%, #f7931e 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  animation: devBannerSlide 0.3s ease-out;
}

.setup-dev-banner > * {
  margin-right: 12px;
}

.setup-dev-banner > *:last-child {
  margin-right: 0;
}

@keyframes devBannerSlide {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.setup-dev-banner__icon {
  font-size: 24px;
}

.setup-dev-banner__text {
  flex: 1;
  text-align: center;
}

.setup-dev-banner__text strong {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.setup-dev-banner__close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.setup-dev-banner__close:hover,
.setup-dev-banner__close:focus {
  background: rgba(255, 255, 255, 0.35);
  outline: none;
}

.setup-dev-banner.hidden {
  display: none;
}
