/* === TOUCHTERM • APPLE NATIVE HIG DARK THEME === */
:root {
  --bg-black: #000000;
  --bg-card: #1C1C1E;
  --bg-card-subtle: #2C2C2E;
  --bg-overlay: rgba(28, 28, 30, 0.85);
  --border-subtle: #2C2C2E;
  --border-accent: rgba(255, 255, 255, 0.15);
  --text-primary: #FFFFFF;
  --text-secondary: #8E8E93;
  --text-muted: #636366;
  --accent-green: #30D158;
  --accent-blue: #0A84FF;
  --accent-indigo: #5E5CE6;
  --accent-orange: #FF9F0A;
  --accent-red: #FF453A;
  --accent-gray: #3A3A3C;
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
  --header-height: 48px;
  --accessory-height: 48px;
}

* {
  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%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-black);
  color: var(--text-primary);
  font-family: var(--font-system);
  overflow: hidden;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

/* Master App Container tied to visualViewport */
#app-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-black);
  overscroll-behavior: none;
  touch-action: none;
}

/* === HEADER / STATUS BAR === */
/* Default (Regular browser: Safari/Chrome/Desktop) - NO status bar buffer */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  padding-top: 0;
  background: rgba(20, 20, 22, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 50;
  box-sizing: border-box;
}

/* Standalone PWA ONLY - Account for iOS hardware status bar buffer */
html.is-pwa .app-header,
body.is-pwa .app-header {
  --safe-top: max(34px, env(safe-area-inset-top, 34px));
  height: calc(var(--header-height) + var(--safe-top)) !important;
  min-height: calc(var(--header-height) + var(--safe-top)) !important;
  padding-top: var(--safe-top) !important;
  padding-left: max(14px, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(14px, env(safe-area-inset-right, 0px)) !important;
}

@media all and (display-mode: standalone) {
  .app-header {
    --safe-top: max(34px, env(safe-area-inset-top, 34px));
    height: calc(var(--header-height) + var(--safe-top)) !important;
    min-height: calc(var(--header-height) + var(--safe-top)) !important;
    padding-top: var(--safe-top) !important;
    padding-left: max(14px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(14px, env(safe-area-inset-right, 0px)) !important;
  }
}

.header-left {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === MULTI-TAB NAVIGATION BAR === */
.tabs-nav-bar {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.tabs-scroll-area {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-width: 0;
  padding: 2px 0;
}

.tabs-scroll-area::-webkit-scrollbar {
  display: none;
}

.tabs-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

.tab-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.tab-pill.active {
  background: rgba(10, 132, 255, 0.2);
  border-color: rgba(10, 132, 255, 0.6);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(10, 132, 255, 0.3);
}

.tab-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.tab-title {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 2px;
  transition: all 0.15s ease;
  padding: 0;
  font-size: 11px;
}

.tab-close:hover {
  background: rgba(255, 69, 58, 0.25);
  color: var(--accent-red);
}

.new-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.new-tab-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.new-tab-btn:active {
  transform: scale(0.95);
}

.close-window-btn {
  color: var(--text-muted);
}

.close-window-btn:hover {
  background: rgba(255, 69, 58, 0.22);
  border-color: rgba(255, 69, 58, 0.5);
  color: #FF453A;
  transform: scale(1.05);
}

.close-window-btn:active {
  transform: scale(0.95);
  background: rgba(255, 69, 58, 0.35);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-orange);
  transition: background 0.2s ease;
}

.status-dot.connected {
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.6);
  animation: pulse 2.5s infinite;
}

.status-dot.disconnected {
  background: var(--accent-red);
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.host-badge {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 600;
}

.session-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent-blue);
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.25);
  padding: 2px 6px;
  border-radius: 6px;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Header Buttons */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: scale(0.95);
}

.icon-btn.active {
  color: var(--accent-blue);
  background: rgba(10, 132, 255, 0.15);
}

/* === TERMINAL DISPLAY AREA === */
#terminal-container {
  flex: 1;
  position: relative;
  background-color: var(--bg-black);
  overflow: hidden;
  padding: 6px 6px 0 6px;
  overscroll-behavior: none;
  touch-action: pan-y;
}

/* === HOMESCREEN / LAUNCHPAD (ZERO-FUZZ 3 BIG TILES) === */
.launchpad-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background-color: var(--bg-black);
  user-select: none;
  -webkit-user-select: none;
  overflow-y: auto;
}

.launchpad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 260px));
  gap: 24px;
  max-width: 900px;
  width: 100%;
  justify-content: center;
}

.launchpad-tile {
  background: rgba(28, 28, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 38px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-decoration: none;
  outline: none;
}

.launchpad-tile:hover {
  background: rgba(44, 44, 46, 0.85);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(10, 132, 255, 0.15);
}

.launchpad-tile:active {
  transform: scale(0.96);
  background: rgba(58, 58, 60, 0.9);
}

.launchpad-icon {
  font-size: 3.4rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.launchpad-title {
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
}

@media (max-width: 700px) {
  .launchpad-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    gap: 16px;
  }
  .launchpad-tile {
    padding: 22px 18px;
    border-radius: 18px;
    flex-direction: row;
    gap: 16px;
    justify-content: flex-start;
  }
  .launchpad-icon {
    font-size: 2.2rem;
  }
  .launchpad-title {
    font-size: 1rem;
    text-align: left;
  }
}

.terminal-tab-view {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 6px 0 6px;
  box-sizing: border-box;
}

/* Allow text selection inside xterm canvas / rows */
#terminal-container .xterm,
.terminal-tab-view .xterm {
  height: 100%;
  user-select: text;
  -webkit-user-select: text;
}

/* === NEW TAB SELECTION MODAL === */
.tab-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.tab-option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.tab-option-card:hover {
  background: var(--bg-card-subtle);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.tab-option-card:active {
  transform: scale(0.98);
}

.tab-option-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.tab-option-content {
  flex: 1;
  min-width: 0;
}

.tab-option-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.tab-option-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Ensure xterm hidden textarea is focusable and allows paste without jumping */
.xterm .xterm-helper-textarea {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0.001 !important;
  z-index: -1 !important;
  pointer-events: auto !important;
}

.xterm-viewport {
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for xterm */
.xterm-viewport::-webkit-scrollbar {
  width: 5px;
}
.xterm-viewport::-webkit-scrollbar-track {
  background: transparent;
}
.xterm-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* === FLOATING ACCESSORY TOOLBAR === */
/* Shown ONLY on mobile phone viewports (< 768px). Strictly hidden on iPads, tablets, and desktops */
.accessory-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  padding-bottom: max(5px, env(safe-area-inset-bottom, 5px));
  background: rgba(28, 28, 30, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--border-subtle);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 60;
  scrollbar-width: none;
}

@media (min-width: 768px) {
  .accessory-bar {
    display: none !important;
  }
}

.accessory-bar::-webkit-scrollbar {
  display: none;
}

/* === DRAG & DROP / PASTE UPLOAD OVERLAY === */
.drop-zone-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-zone-card {
  background: #1C1C1E;
  border: 2px dashed var(--accent-green);
  border-radius: 20px;
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  text-align: center;
}

/* Floating Upload Toast Notification */
.upload-toast {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 28, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  animation: fadeInDown 0.2s ease;
}

html.is-pwa .upload-toast,
body.is-pwa .upload-toast {
  top: calc(var(--header-height) + max(34px, env(safe-area-inset-top, 34px)) + 12px) !important;
}

@media all and (display-mode: standalone) {
  .upload-toast {
    top: calc(var(--header-height) + max(34px, env(safe-area-inset-top, 34px)) + 12px) !important;
  }
}

.paste-modal-textarea {
  width: 100%;
  height: 140px;
  background: #0D0D0E;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.4;
  padding: 12px;
  outline: none;
  resize: none;
  user-select: auto;
  -webkit-user-select: auto;
  box-sizing: border-box;
  margin-top: 6px;
}

.paste-modal-textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.acc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 38px;
  padding: 0 10px;
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.1s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.acc-btn:active {
  background: #3A3A3C;
  transform: scale(0.94);
  box-shadow: none;
}

.acc-btn.active {
  background: var(--accent-blue);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 10px rgba(10, 132, 255, 0.5);
}

.acc-btn.special-paste {
  color: var(--accent-blue);
  font-weight: 700;
  border-color: rgba(10, 132, 255, 0.35);
}

.acc-btn.special-c {
  color: var(--accent-red);
}

.acc-btn.special-agy {
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.2), rgba(10, 132, 255, 0.2));
  color: var(--accent-green);
  border-color: rgba(48, 209, 88, 0.4);
  font-weight: 700;
}
.acc-btn.special-agy:active {
  background: var(--accent-green);
  color: #000;
}

.acc-btn.keyboard-toggle {
  margin-left: auto;
  min-width: 36px;
  padding: 0 8px;
  color: var(--text-secondary);
}

/* === QUICK COMMANDS MODAL / MENU === */
.quick-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.quick-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.quick-menu-sheet {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  padding: 18px;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-menu-overlay.open .quick-menu-sheet {
  transform: translateY(0);
}

.quick-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.quick-menu-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quick-item-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.quick-item-btn:active {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0.97);
}

.quick-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-blue);
  margin-bottom: 2px;
}

.quick-item-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* === AUTHENTICATION LOCK OVERLAY === */
.auth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

html.is-pwa .auth-overlay,
body.is-pwa .auth-overlay {
  padding-top: max(20px, env(safe-area-inset-top, 20px));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.auth-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(48, 209, 88, 0.1);
  border: 1px solid rgba(48, 209, 88, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 0 20px rgba(48, 209, 88, 0.2);
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.4;
}

.auth-tabs {
  display: flex;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 18px;
}

.auth-tab-btn {
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--text-secondary);
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: #2C2C2E;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.totp-input {
  width: 100%;
  height: 58px;
  background: #0D0D0E;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.35em;
  padding: 0 16px;
  outline: none;
  transition: all 0.2s ease;
  user-select: auto;
  -webkit-user-select: auto;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.totp-input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 1px var(--accent-green), inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.totp-input::placeholder {
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 0.35em;
}

.setup-drawer {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.setup-qr-wrap {
  background: #FFFFFF;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.setup-qr-img {
  width: 145px;
  height: 145px;
  display: block;
}

.setup-secret-box {
  width: 100%;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-green);
  word-break: break-all;
  text-align: center;
  user-select: all;
  -webkit-user-select: all;
}

.setup-toggle-btn {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 0 auto;
  border-radius: 6px;
  transition: opacity 0.15s ease;
}

.setup-toggle-btn:active {
  opacity: 0.7;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input {
  width: 100%;
  height: 48px;
  background: #0D0D0E;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.1em;
  padding: 0 16px;
  outline: none;
  transition: border-color 0.2s;
  user-select: auto;
  -webkit-user-select: auto;
}

.auth-input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 1px var(--accent-green);
}

.remember-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.remember-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-green);
  cursor: pointer;
}

.auth-btn {
  width: 100%;
  height: 48px;
  background: var(--accent-green);
  color: #000000;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  margin-top: 4px;
}

.auth-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.auth-error {
  color: var(--accent-red);
  font-size: 0.82rem;
  margin-top: -4px;
  display: none;
}

.security-badges {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
