/* ==========================================================================
   Spotlight AI Web App - Apple Human Interface Design for iPhone & iPad
   ========================================================================== */

:root {
  --bg-pure-black: #000000;
  --bg-surface-1: #161618;
  --bg-surface-2: #1c1c1e;
  --bg-surface-3: #242426;
  --bg-surface-4: #2c2c2e;

  --glass-bg: rgba(26, 26, 28, 0.78);
  --glass-dock: rgba(20, 20, 22, 0.85);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-highlight: rgba(255, 255, 255, 0.05);

  --text-primary: #f5f5f7;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-tertiary: rgba(255, 255, 255, 0.42);

  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-bright-blue: #2997ff;
  --apple-gold: #ffd60a;
  --apple-green: #30d158;
  --apple-red: #ff453a;

  --sidebar-width: 290px;
  --top-nav-height: 56px;
  --bottom-dock-height: 72px;

  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-pure-black);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Root Flex Container */
.app-root {
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for iOS */
  overflow: hidden;
  position: relative;
  background-color: var(--bg-pure-black);
}

/* ==========================================================================
   iPadOS Style Sidebar (Drawer on iPhone)
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-surface-1);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.32s var(--ease-apple), box-shadow 0.32s var(--ease-apple);
  flex-shrink: 0;
}

.sidebar-header {
  height: calc(var(--top-nav-height) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: 18px;
  padding-right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.brand-text h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.brand-text span {
  font-size: 11px;
  color: var(--apple-bright-blue);
  font-weight: 500;
}

.sidebar-close-btn {
  display: none; /* Only visible on iPhone */
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}

.sidebar-action {
  padding: 14px 16px 8px;
}

.new-chat-btn {
  width: 100%;
  padding: 10px 14px;
  background: var(--apple-blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35);
  transition: all 0.18s ease;
}

.new-chat-btn:active {
  transform: scale(0.98);
  background: var(--apple-blue-hover);
}

.sidebar-section-title {
  padding: 12px 18px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.session-item:hover, .session-item:active {
  background: var(--bg-surface-3);
}

.session-item.active {
  background: rgba(0, 113, 227, 0.18);
  border: 1px solid rgba(41, 151, 255, 0.3);
}

.session-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 2px;
}

.session-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-time {
  font-size: 10.5px;
  color: var(--text-tertiary);
}

.session-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  opacity: 0.6;
}

.session-delete-btn:hover {
  opacity: 1;
  color: var(--apple-red);
}

/* Sidebar Footer Status Card */
.sidebar-status-card {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--glass-border);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.6);
}

.status-dot.offline {
  background: var(--apple-red);
  box-shadow: 0 0 8px rgba(255, 69, 58, 0.6);
}

.status-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.status-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.detail-item .k {
  color: var(--text-tertiary);
}

.detail-item .v {
  color: var(--text-secondary);
  font-weight: 500;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 40;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background: var(--bg-pure-black);
  overflow: hidden;
}

/* Top Navigation Bar */
.top-nav {
  height: calc(var(--top-nav-height) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-bottom: 1px solid var(--glass-border);
  z-index: 30;
  flex-shrink: 0;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.nav-icon-btn:active {
  background: var(--bg-surface-3);
}

.action-pill-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 999px;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
}

.action-pill-btn:active {
  background: rgba(255, 255, 255, 0.16);
}

.nav-title-group {
  display: flex;
  flex-direction: column;
}

.nav-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.nav-sub {
  font-size: 11px;
  color: var(--apple-bright-blue);
  font-weight: 500;
}

/* Chat Scroll Canvas */
.chat-scroll-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  display: flex;
  flex-direction: column;
}

.chat-inner {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px calc(var(--bottom-dock-height) + var(--safe-bottom) + 30px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Empty State Hero */
.empty-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: auto 0;
  padding: 40px 16px 20px;
}

.hero-badge {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 24px rgba(0, 113, 227, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  position: relative;
}

.hero-badge .apple-logo {
  font-size: 32px;
  color: #fff;
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #fff;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 30px;
  line-height: 1.45;
}

.quick-prompts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 580px;
}

.quick-prompt-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.quick-prompt-card:hover, .quick-prompt-card:active {
  background: var(--bg-surface-3);
  border-color: rgba(41, 151, 255, 0.4);
  transform: translateY(-1px);
}

.quick-prompt-card .icon {
  font-size: 20px;
  flex-shrink: 0;
}

.quick-prompt-card .text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

/* ==========================================================================
   Chat Messages & Dual Persona Bubble Cards
   ========================================================================== */
.message-thread {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.msg-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: fadeIn 0.24s var(--ease-apple);
}

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

/* Boss Message Bubble */
.msg-row.boss {
  align-items: flex-end;
}

.boss-bubble {
  max-width: 82%;
  background: linear-gradient(135deg, #0071e3 0%, #0056b3 100%);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 18px 18px 4px 18px;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3);
  word-break: break-word;
}

.msg-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 5px;
  padding: 0 4px;
}

/* Assistant (Wednesday & Sunday) Card */
.msg-row.assistant {
  align-items: flex-start;
}

.assistant-card {
  width: 100%;
  background: var(--bg-surface-2);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.assistant-header {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.persona-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-wednesday {
  background: rgba(142, 142, 147, 0.16);
  color: #c7c7cc;
  border: 1px solid rgba(142, 142, 147, 0.3);
}

.badge-sunday {
  background: rgba(255, 214, 10, 0.16);
  color: var(--apple-gold);
  border: 1px solid rgba(255, 214, 10, 0.3);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.card-btn:active {
  background: var(--bg-surface-3);
  color: #fff;
}

/* Markdown Content Styling */
.assistant-body {
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
}

.assistant-body p {
  margin-bottom: 12px;
}

.assistant-body p:last-child {
  margin-bottom: 0;
}

.assistant-body strong {
  color: #fff;
  font-weight: 600;
}

/* Highlight Dual Persona Dialogue */
.assistant-body p strong:first-child {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  margin-right: 4px;
  font-size: 13.5px;
}

.assistant-body h1, .assistant-body h2, .assistant-body h3, .assistant-body h4 {
  color: #fff;
  margin-top: 18px;
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.assistant-body h2 { font-size: 17px; }
.assistant-body h3 { font-size: 15px; }

.assistant-body hr {
  border: none;
  height: 1px;
  background: var(--glass-border);
  margin: 16px 0;
}

.assistant-body ul, .assistant-body ol {
  padding-left: 22px;
  margin-bottom: 12px;
}

.assistant-body li {
  margin-bottom: 4px;
}

.assistant-body blockquote {
  border-left: 3px solid var(--apple-bright-blue);
  padding: 8px 14px;
  margin: 12px 0;
  background: rgba(41, 151, 255, 0.08);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

.assistant-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "SF Mono", Menlo, Monaco, monospace;
  font-size: 13px;
  color: #ff9f0a;
}

.assistant-body pre {
  background: #111113;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
  margin: 14px 0;
}

.assistant-body pre code {
  background: transparent;
  padding: 0;
  color: #e5e5ea;
  font-size: 13px;
}

.assistant-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.assistant-body th, .assistant-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
}

.assistant-body th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  text-align: left;
  color: #fff;
}

/* Tool execution steps pill */
.tool-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 113, 227, 0.15);
  border: 1px solid rgba(41, 151, 255, 0.3);
  border-radius: 8px;
  font-size: 12px;
  color: var(--apple-bright-blue);
  margin-bottom: 12px;
}

/* Live Thinking Spinner */
.live-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-surface-2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  width: fit-content;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.status-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--apple-bright-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.status-msg {
  font-size: 13px;
  color: var(--apple-bright-blue);
  font-weight: 500;
}

/* ==========================================================================
   Bottom Input Dock (Tailored for iPhone safe area)
   ========================================================================== */
.bottom-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass-dock);
  backdrop-filter: blur(35px) saturate(190%);
  -webkit-backdrop-filter: blur(35px) saturate(190%);
  border-top: 1px solid var(--glass-border);
  z-index: 30;
}

.dock-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 16px 0;
  display: flex;
  flex-direction: column;
}

/* Attachment Tray */
.attachment-tray {
  display: flex;
  gap: 8px;
  padding-bottom: 8px;
  overflow-x: auto;
}

.tray-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-3);
  border: 1px solid var(--glass-border);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.tray-chip .remove-chip {
  cursor: pointer;
  color: var(--text-tertiary);
}

.tray-chip .remove-chip:hover {
  color: var(--apple-red);
}

/* Input Bar */
.input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-surface-2);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 6px 8px 6px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-bar:focus-within {
  border-color: rgba(41, 151, 255, 0.5);
  box-shadow: 0 0 16px rgba(0, 113, 227, 0.25);
}

.dock-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 2px;
  transition: color 0.15s ease;
}

.dock-btn:active {
  color: var(--apple-bright-blue);
}

#promptInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  padding: 6px 0;
  resize: none;
  max-height: 140px;
  min-height: 24px;
  font-family: inherit;
}

#promptInput::placeholder {
  color: var(--text-tertiary);
}

.send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.send-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  cursor: default;
}

.send-btn:not(:disabled):active {
  transform: scale(0.92);
  background: var(--apple-blue-hover);
}

.safe-area-spacer {
  height: max(10px, var(--safe-bottom));
}

/* ==========================================================================
   iOS PWA Tip & Toast
   ========================================================================== */
.ios-pwa-tip {
  position: fixed;
  bottom: calc(var(--bottom-dock-height) + var(--safe-bottom) + 16px);
  left: 16px;
  right: 16px;
  max-width: 440px;
  margin: 0 auto;
  background: rgba(28, 28, 30, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 100;
  animation: slideUp 0.3s var(--ease-apple);
}

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

.pwa-tip-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-tip-icon {
  font-size: 24px;
}

.pwa-tip-text {
  display: flex;
  flex-direction: column;
}

.pwa-tip-text strong {
  font-size: 13px;
  color: #fff;
}

.pwa-tip-text span {
  font-size: 11px;
  color: var(--text-secondary);
}

.pwa-tip-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.apple-toast {
  position: fixed;
  top: calc(var(--top-nav-height) + var(--safe-top) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(40, 40, 44, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Responsive Breakpoints: iPhone vs iPad
   ========================================================================== */

/* iPhone Screen (< 768px) */
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .sidebar-close-btn {
    display: block;
  }

  .btn-text {
    display: none; /* Hide text on small screens, keep icon */
  }

  .quick-prompts-grid {
    grid-template-columns: 1fr;
  }

  .boss-bubble {
    max-width: 88%;
  }

  .hero-title {
    font-size: 19px;
  }
}

/* iPad / Tablet / Desktop (>= 768px) */
@media (min-width: 768px) {
  .sidebar {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
  }

  .sidebar-backdrop {
    display: none !important;
  }
}

/* ==========================================================================
   Apple Passcode Lock Screen (iPhone & iPad Style)
   ========================================================================== */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(48px) saturate(180%);
  -webkit-backdrop-filter: blur(48px) saturate(180%);
  padding: 24px;
  opacity: 1;
  transition: opacity 0.35s var(--ease-apple), visibility 0.35s;
}

.lock-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lock-card {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.lock-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.lock-badge .apple-logo {
  font-size: 26px;
  color: #ffffff;
  line-height: 1;
}

.lock-title {
  font-size: 21px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

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

/* PIN Dots */
.pin-dots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
  height: 24px;
}

.pin-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pin-dot.filled {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  transform: scale(1.12);
}

/* Wrong PIN Shake Animation */
@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-14px); }
  40%, 80% { transform: translateX(14px); }
}

.pin-dots-row.shake {
  animation: pinShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.pin-dots-row.shake .pin-dot {
  border-color: var(--apple-red);
  background-color: var(--apple-red);
  box-shadow: 0 0 10px rgba(255, 69, 58, 0.6);
}

.lock-error-msg {
  font-size: 13px;
  color: var(--apple-red);
  margin-bottom: 14px;
  min-height: 18px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.hidden-pin-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Keypad Grid (3x4) */
.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 16px 22px;
  justify-content: center;
  margin-top: 10px;
}

.key-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 26px;
  font-weight: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.key-btn:active {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(0.92);
}

.key-btn.key-backspace {
  font-size: 20px;
  background: transparent;
  border-color: transparent;
  color: rgba(255, 255, 255, 0.7);
}

.key-btn.key-backspace:active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.key-placeholder {
  width: 72px;
  height: 72px;
}

.lock-hint {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
}

