/* ==========================================================================
   BLUE STAR AC REMOTE - REALISTIC PHYSICAL REPLICA STYLESHEET
   Accurately replicates physical white Blue Star remote appliance.
   Zero emojis. High-performance, clean CSS.
   ========================================================================== */

:root {
  --page-bg: #1e2229;
  --topbar-bg: #14181f;
  --topbar-border: #29303c;
  --text-primary: #f1f5f9;
  --text-muted: #94a3b8;

  /* Physical Remote Colors */
  --remote-body-bg: #f5f6f2;
  --remote-border: #d4d6cf;
  --remote-shadow: 0 20px 40px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
  
  /* Authentic LCD Palette */
  --lcd-bezel: #121416;
  --lcd-bg: #9ab18b;
  --lcd-bg-inner: #94ab85;
  --lcd-pixel: #142111;
  --lcd-pixel-faint: rgba(20, 33, 17, 0.08);

  /* Tactile Physical Keypad */
  --btn-white-bg: #ffffff;
  --btn-white-border: #d5d7d0;
  --btn-white-shadow: 0 3px 0 #c0c3bb, 0 4px 6px rgba(0, 0, 0, 0.12);
  --btn-white-text: #27303f;

  --btn-green-bg: #5ba627;
  --btn-green-border: #284712;
  --btn-green-shadow: 0 3px 0 #3b6b19, 0 4px 6px rgba(0, 0, 0, 0.16);
  --btn-green-text: #0d1e08;

  --bluestar-blue: #005ba4;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--page-bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   TOP CONTROL BAR
   ========================================================================== */
.app-topbar {
  width: 100%;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  padding: 0.65rem 1.25rem;
}

.topbar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-brand {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.brand-text {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.conn-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid var(--topbar-border);
  background: rgba(255, 255, 255, 0.03);
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.conn-tag.online { color: #34d399; }
.conn-tag.online .conn-dot { background: #10b981; }

.conn-tag.offline { color: #f87171; }
.conn-tag.offline .conn-dot { background: #ef4444; }

.conn-tag.syncing { color: #fbbf24; }
.conn-tag.syncing .conn-dot { background: #f59e0b; }

.device-picker select {
  background: #1e242d;
  color: var(--text-primary);
  border: 1px solid var(--topbar-border);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
}

.topbar-btn {
  background: transparent;
  border: 1px solid var(--topbar-border);
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-btn:hover {
  color: #ffffff;
  border-color: #64748b;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   MAIN PAGE BODY
   ========================================================================== */
.page-body {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}

/* ==========================================================================
   AUTHENTICATION VIEW (Sign In)
   ========================================================================== */
.auth-box {
  width: 100%;
  max-width: 360px;
  background: #181d24;
  border: 1px solid var(--topbar-border);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.auth-head {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-head h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.auth-head p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #10141a;
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  border: 1px solid var(--topbar-border);
}

.auth-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab-btn.active {
  background: #1e242d;
  color: #ffffff;
}

.auth-form .input-group {
  margin-bottom: 1rem;
}

.auth-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.auth-form input {
  width: 100%;
  background: #10141a;
  border: 1px solid var(--topbar-border);
  border-radius: 7px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  color: #ffffff;
  font-family: inherit;
  outline: none;
}

.auth-form input:focus {
  border-color: #38bdf8;
}

.phone-wrap {
  display: flex;
  background: #10141a;
  border: 1px solid var(--topbar-border);
  border-radius: 7px;
  overflow: hidden;
}

.phone-code {
  padding: 0 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid var(--topbar-border);
}

.phone-wrap input {
  border: none;
  border-radius: 0;
}

.error-msg {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.55rem 0.75rem;
  border-radius: 7px;
  font-size: 0.78rem;
  margin-bottom: 1rem;
}

.btn-connect {
  width: 100%;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 7px;
  padding: 0.7rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: background 0.15s ease;
}

.btn-connect:hover {
  background: #0369a1;
}

/* ==========================================================================
   REALISTIC PHYSICAL REMOTE ENCLOSURE (Matches User Photo)
   ========================================================================== */
.remote-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.remote-unit {
  width: 280px;
  background-color: var(--remote-body-bg);
  border: 1px solid var(--remote-border);
  border-radius: 18px;
  box-shadow: var(--remote-shadow);
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  user-select: none;
}

/* ==========================================================================
   LCD DISPLAY (Realistic Green Monochromatic Liquid Crystal)
   ========================================================================== */
.lcd-outer-bezel {
  background: var(--lcd-bezel);
  border-radius: 8px;
  padding: 7px;
  margin-bottom: 18px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(255, 255, 255, 0.4);
}

.lcd-screen {
  background: linear-gradient(to bottom, var(--lcd-bg), var(--lcd-bg-inner));
  border-radius: 5px;
  padding: 8px 10px;
  color: var(--lcd-pixel);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 154px;
  position: relative;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

/* Ghost / Dormant state when AC is turned OFF */
.lcd-screen.lcd-off {
  opacity: 0.32;
}

.lcd-screen.lcd-off .mode-svg,
.lcd-screen.lcd-off .lcd-digits,
.lcd-screen.lcd-off .lcd-tag,
.lcd-screen.lcd-off .f-bar,
.lcd-screen.lcd-off .sub-ind,
.lcd-screen.lcd-off .lcd-swing-graphic,
.lcd-screen.lcd-off .lcd-light-graphic {
  opacity: 0.08 !important;
}

/* LCD Top Row: Mode & Clock */
.lcd-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
}

.lcd-mode-symbol {
  display: flex;
  align-items: center;
  width: 24px;
  height: 24px;
}

.mode-svg {
  width: 20px;
  height: 20px;
  display: none;
  color: var(--lcd-pixel);
}

.mode-svg.active {
  display: block;
}

.lcd-clock {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: 'Share Tech Mono', monospace;
  color: var(--lcd-pixel);
}

.clock-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.clock-time {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.clock-time .am-pm {
  font-size: 9px;
  font-weight: 700;
}

/* LCD Middle Row: Target Temp & Fan */
.lcd-middle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  border-top: 1px solid rgba(20, 33, 17, 0.15);
  border-bottom: 1px solid rgba(20, 33, 17, 0.15);
}

.lcd-temp-section {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}

.lcd-digits {
  font-family: 'Share Tech Mono', monospace;
  font-size: 46px;
  line-height: 0.95;
  font-weight: 700;
  color: var(--lcd-pixel);
  letter-spacing: -2px;
  min-width: 54px;
}

.lcd-temp-meta {
  display: flex;
  flex-direction: column;
  padding-top: 4px;
}

.lcd-tag {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--lcd-pixel);
  color: var(--lcd-bg);
  padding: 1px 3px;
  border-radius: 2px;
  line-height: 1.1;
  margin-bottom: 2px;
}

.lcd-celsius {
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--lcd-pixel);
}

.lcd-fan-section {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding-right: 4px;
}

.fan-icon-small {
  color: var(--lcd-pixel);
  animation: none;
}

.fan-bars-vertical {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
}

.f-bar {
  width: 4px;
  background: rgba(20, 33, 17, 0.12);
  border-radius: 1px;
}

.f-bar.bar-1 { height: 7px; }
.f-bar.bar-2 { height: 13px; }
.f-bar.bar-3 { height: 19px; }

.f-bar.active {
  background: var(--lcd-pixel);
}

/* LCD Sub Indicators */
.lcd-sub-indicators {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  height: 12px;
}

.sub-ind {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--lcd-pixel);
  opacity: 0.15;
}

.sub-ind.active {
  opacity: 1;
}

/* LCD Bottom Row: Swing & Light Graphic */
.lcd-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.lcd-swing-graphic {
  color: var(--lcd-pixel);
  opacity: 0.18;
  display: flex;
  align-items: center;
}

.lcd-swing-graphic.active {
  opacity: 1;
}

.lcd-light-graphic {
  color: var(--lcd-pixel);
  opacity: 0.18;
  display: flex;
  align-items: center;
}

.lcd-light-graphic.active {
  opacity: 1;
}

/* ==========================================================================
   PHYSICAL KEYPAD (Buttons strictly matching user photo)
   ========================================================================== */
.remote-keypad {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.btn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: center;
  justify-items: center;
}

/* Common Tactile Button Style */
.btn-remote {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

/* Active Press Effect (Simulates physical click) */
.btn-remote:active {
  transform: translateY(2px);
}

/* 1. White Rectangular Buttons (MODE, FAN, SWING, ENERGY SAVE, TURBO, SLEEP, LIGHT) */
.btn-rect {
  width: 100%;
  height: 38px;
  background-color: var(--btn-white-bg);
  border: 1px solid var(--btn-white-border);
  border-radius: 8px;
  box-shadow: var(--btn-white-shadow);
  color: var(--btn-white-text);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.btn-rect:active {
  box-shadow: 0 1px 0 #c0c3bb, 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-subtext {
  font-size: 0.6rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1;
  margin-bottom: 1px;
}

/* 2. ON/OFF Green Squircle Button */
.btn-power-green {
  width: 100%;
  height: 38px;
  background-color: var(--btn-green-bg);
  border: 2px solid var(--btn-green-border);
  border-radius: 7px;
  box-shadow: var(--btn-green-shadow);
  color: var(--btn-green-text);
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.btn-power-green:active {
  box-shadow: 0 1px 0 #3b6b19, 0 1px 3px rgba(0, 0, 0, 0.16);
}

.btn-power-green svg {
  stroke: var(--btn-green-text);
}

/* 3. Circular White Buttons (TIMER ON, TEMP, TIMER OFF, CLOCK) */
.btn-round {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--btn-white-bg);
  border: 1px solid var(--btn-white-border);
  box-shadow: var(--btn-white-shadow);
  color: var(--btn-white-text);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.btn-round:active {
  box-shadow: 0 1px 0 #c0c3bb, 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* 4. Circular Green Buttons (+ and -) */
.btn-round-green {
  background-color: var(--btn-green-bg);
  border: 1px solid var(--btn-green-border);
  box-shadow: var(--btn-green-shadow);
  color: #0b1a06;
}

.btn-round-green:active {
  box-shadow: 0 1px 0 #3b6b19, 0 1px 3px rgba(0, 0, 0, 0.16);
}

.math-sign {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

/* Row 5 Spacer */
.btn-spacer {
  width: 100%;
}

/* ==========================================================================
   BLUE STAR LOGO BADGE (Bottom of remote)
   ========================================================================== */
.remote-foot-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 8px;
}

.logo-box {
  background-color: var(--bluestar-blue);
  color: #ffffff;
  padding: 3px 8px 3px 4px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.logo-star-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
}

.logo-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #ffffff;
}
