/* Modern Sci-Fi / Industrial Telemetry Theme */
:root {
  --bg-primary: #0b1120;
  --bg-secondary: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --border-color: #334155;
  --border-highlight: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #38bdf8;
  --accent-blue: #0284c7;
  --accent-green: #22c55e;
  --accent-yellow: #eab308;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header */
header {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.title-group h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-group p {
  font-size: 12px;
  color: var(--text-secondary);
}

.presets-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preset-btn:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
}

.preset-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* App Main Container */
.app-layout {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 16px;
  padding: 16px;
  flex: 1;
}

@media (max-width: 1200px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

/* Left Section: Visual Building View */
.building-section {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.building-header {
  padding: 10px 16px;
  background: rgba(30, 41, 59, 0.5);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.canvas-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sm:hover {
  background: var(--border-color);
  color: #fff;
}

.btn-sm.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-cyan);
}

.btn-fire {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--accent-red);
  color: #fca5a5;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  animation: pulse-border 2s infinite;
}

.btn-fire:hover {
  background: var(--accent-red);
  color: #fff;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.canvas-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #070b14;
  min-height: 600px;
  overflow: hidden;
}

#buildingCanvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 3D WebGL Canvas Container */
#container3D {
  width: 100%;
  height: 100%;
  min-height: 600px;
  position: absolute;
  top: 0;
  left: 0;
  outline: none;
}

#container3D canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.view-mode-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.camera-controls-3d {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.6);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.hud-tooltip-3d {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #38bdf8;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  min-width: 230px;
  backdrop-filter: blur(4px);
}

/* Alert Overlay Banner */
.alarm-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.95);
  border: 2px solid #f87171;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.7);
  z-index: 10;
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Canvas Legend Footer */
.canvas-legend {
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot.green { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.dot.yellow { background: var(--accent-yellow); }
.dot.orange { background: var(--accent-orange); }
.dot.red { background: var(--accent-red); box-shadow: 0 0 6px var(--accent-red); }
.dot.stair { background: #38bdf8; }

/* Right Section: Telemetry & Controls */
.telemetry-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.telemetry-section::-webkit-scrollbar {
  width: 6px;
}
.telemetry-section::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
}

.card-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  padding-bottom: 6px;
}

/* Control Groups */
.control-row {
  margin-bottom: 12px;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.control-val {
  font-family: monospace;
  font-weight: 700;
  color: #fff;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: #334155;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-cyan);
}

.btn-group {
  display: flex;
  gap: 4px;
  width: 100%;
}

.btn-toggle {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.btn-toggle:hover {
  background: var(--bg-card-hover);
  color: #fff;
}

.btn-toggle.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Quick Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.metric-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
}

.metric-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-val {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  font-family: monospace;
}

.metric-val.green { color: var(--accent-green); }
.metric-val.cyan { color: var(--accent-cyan); }
.metric-val.yellow { color: var(--accent-yellow); }
.metric-val.red { color: var(--accent-red); }

.metric-sub {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Battery Progress Bar */
.battery-life-bar {
  height: 8px;
  background: #334155;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.battery-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #38bdf8 100%);
  width: 85%;
  transition: width 0.3s ease;
}

/* Link Budget Table */
.data-table-wrapper {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

th {
  background: #1e293b;
  color: var(--text-secondary);
  padding: 6px 8px;
  position: sticky;
  top: 0;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  font-family: monospace;
}

tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

.badge-status {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  display: inline-block;
}

.badge-ok { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid #22c55e; }
.badge-warn { background: rgba(234, 179, 8, 0.2); color: #fde047; border: 1px solid #eab308; }
.badge-lost { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid #ef4444; }
.badge-rep { background: rgba(168, 85, 247, 0.25); color: #d8b4fe; border: 1px solid #a855f7; }

/* Warning note */
.callout-info {
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 8px;
}

.callout-warning {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--accent-red);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  color: #fca5a5;
  line-height: 1.4;
  margin-top: 8px;
  display: none;
}

/* ==========================================================================
   Modern Tab Navigation & Panels
   ========================================================================== */
.tab-nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--bg-primary);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.tab-nav {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.45);
}

.tab-btn .tab-icon {
  font-size: 14px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: tabFadeIn 0.25s ease-out;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Large Fire Trigger Button */
.btn-fire-large {
  width: 100%;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(185, 28, 28, 0.4) 100%);
  border: 1.5px solid var(--accent-red);
  color: #fca5a5;
  font-weight: 700;
  font-size: 13px;
  padding: 11px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  animation: pulse-border 2s infinite;
  min-height: 44px;
  margin-top: 6px;
}

.btn-fire-large:hover {
  background: var(--accent-red);
  color: #fff;
  transform: translateY(-1px);
}

/* Preset Pill Grid in Tab 1 */
.preset-grid-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.preset-card-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preset-card-btn:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.preset-card-btn.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

/* Drawer Handle Bar (Hidden on Desktop) */
.drawer-handle-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #0f172a;
  border-radius: 20px 20px 0 0;
  cursor: grab;
}

.drawer-handle {
  width: 44px;
  height: 5px;
  background: #475569;
  border-radius: 3px;
  margin: 0 auto;
}

.drawer-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* Mobile Bottom Navigation (Hidden on Desktop) */
.mobile-bottom-nav {
  display: none;
}

#drawerBackdrop {
  display: none;
}

#btnOpenMobileDrawer {
  display: none;
}

/* ==========================================================================
   Responsive Breakpoints: Mobile App Experience
   ========================================================================== */
@media (max-width: 1024px) {
  body {
    padding-bottom: 60px; /* Space for bottom nav bar */
  }

  header {
    padding: 8px 12px;
  }

  .title-group h1 {
    font-size: 14px;
  }
  .title-group p {
    display: none;
  }

  .presets-container {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .presets-container::-webkit-scrollbar {
    display: none;
  }
  .preset-btn {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 11px;
  }

  .app-layout {
    display: block;
    padding: 8px;
    height: auto;
  }

  .building-section {
    height: calc(100vh - 130px);
    min-height: 480px;
    border-radius: 10px;
  }

  .canvas-wrapper {
    min-height: 380px;
    flex: 1;
  }

  #container3D {
    min-height: 380px;
  }

  .building-header {
    padding: 6px 10px;
    gap: 6px;
  }

  .camera-controls-3d {
    overflow-x: auto;
    max-width: 100%;
    padding: 2px 4px;
  }

  #btnOpenMobileDrawer {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
  }

  /* Telemetry Section as Slide-Up Bottom Drawer on Mobile */
  .telemetry-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80vh;
    background: #0b1120;
    border-top: 2px solid var(--accent-cyan);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.9);
    z-index: 2000;
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 0 14px 24px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .telemetry-section.drawer-open {
    transform: translateY(0);
  }

  .drawer-handle-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 0 -14px 10px -14px;
  }

  .tab-nav-wrapper {
    position: sticky;
    top: 48px;
    background: #0b1120;
  }

  /* Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(11, 17, 32, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    z-index: 1500;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
  }

  .mobile-nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    transition: all 0.15s ease;
  }

  .mobile-nav-btn.active {
    color: var(--accent-cyan);
  }

  .mobile-nav-btn .nav-icon {
    font-size: 18px;
  }

  /* Enlarged Touch Targets for Touchscreens */
  .btn-sm, .btn-toggle, input[type="range"] {
    min-height: 40px;
  }

  .btn-toggle {
    font-size: 11px;
    padding: 8px 4px;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
  }

  /* Backdrop Overlay when Drawer is Open */
  #drawerBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
    z-index: 1999;
  }

  #drawerBackdrop.active {
    display: block;
  }
}

/* ==========================================================================
   AUTHENTICATION & USER BADGE STYLES
   ========================================================================== */
.user-auth-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.user-badge {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-cyan);
}

.user-badge .user-icon {
  font-size: 14px;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

/* Auth Modal Backdrop */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.3s ease;
}

.auth-modal-backdrop.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Auth Card */
.auth-card {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.1);
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  animation: authCardEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #22c55e);
}

@keyframes authCardEnter {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Auth Header */
.auth-header {
  text-align: center;
  margin-bottom: 22px;
}

.auth-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-logo-badge {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.auth-signal-icon {
  font-size: 22px;
}

.auth-title {
  color: #f8fafc;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: #94a3b8;
  font-size: 13px;
}

/* Error Alert */
.auth-error-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  animation: shakeAlert 0.3s ease;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Form Fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.auth-field label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  font-size: 16px;
  color: #64748b;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 12px 14px 12px 38px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  outline: none;
}

.auth-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  background: #0b1120;
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-toggle-pwd:hover {
  opacity: 1;
}

/* Remember me row */
.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
}

.auth-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
  accent-color: #0284c7;
  width: 16px;
  height: 16px;
}

/* Submit Button */
.btn-auth-submit {
  width: 100%;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  margin-top: 6px;
}

.btn-auth-submit:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4);
  transform: translateY(-1px);
}

.btn-auth-submit:active {
  transform: translateY(0);
}

/* Footer */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #1e293b;
}

.auth-footer p {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 8px;
}

.auth-badge-lan {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
