/* iPhone 17 Pro frame — 393×852pt, Dynamic Island, ash bezels */
.phone-frame {
  width: 393px;
  height: 852px;
  border-radius: 50px;
  border: 6px solid #4a4a4e;
  overflow: hidden;
  box-shadow:
    0 0 0 2px #3a3a3e,
    inset 0 0 0 1px #5a5a5e,
    0 25px 60px rgba(0,0,0,0.3);
  position: relative;
  flex-shrink: 0;
  background: #000;
}

/* Dynamic Island */
.phone-frame::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 36px;
  background: #000;
  border-radius: 20px;
  z-index: 50;
  pointer-events: none;
}

/* Side button (power) */
.phone-frame::after {
  content: '';
  position: absolute;
  top: 160px;
  right: -8px;
  width: 3px;
  height: 80px;
  background: #4a4a4e;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

.phone-screen {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}

.phone-screen::-webkit-scrollbar {
  display: none;
}

/* MacBook Pro frame — 1280×800 viewport, Space Black */
.laptop-frame {
  width: 1280px;
  position: relative;
  flex-shrink: 0;
}

/* Screen bezel — Ash */
.laptop-screen {
  width: 1280px;
  height: 800px;
  border-radius: 12px;
  border: 14px solid #4a4a4e;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 2px #3a3a3e,
    inset 0 0 0 1px #5a5a5e,
    0 25px 60px rgba(0,0,0,0.3);
  position: relative;
}

/* Camera notch */
.laptop-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #3a3a3e;
  border-radius: 50%;
  z-index: 50;
  pointer-events: none;
  border: 1px solid #5a5a5e;
}

/* Browser chrome bar */
.laptop-browser-bar {
  height: 36px;
  background: #1e1e1e;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
}

.laptop-browser-bar .dots {
  display: flex;
  gap: 6px;
}

.laptop-browser-bar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.laptop-browser-bar .dot-red { background: #ff5f57; }
.laptop-browser-bar .dot-yellow { background: #febc2e; }
.laptop-browser-bar .dot-green { background: #28c840; }

.laptop-browser-bar .url-bar {
  flex: 1;
  max-width: 400px;
  margin: 0 auto;
  background: #111;
  border-radius: 6px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #666;
  font-family: system-ui, sans-serif;
}

/* Base/hinge — wider than screen, centered, flush against screen */
.laptop-base {
  width: 1380px;
  height: 12px;
  background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
  border-radius: 0 0 10px 10px;
  margin: -2px auto 0 auto;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.laptop-base::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 3px;
  background: #333;
  border-radius: 0 0 3px 3px;
}

.laptop-iframe {
  width: 100%;
  height: calc(100% - 36px);
  border: none;
  overflow: hidden;
}

.laptop-iframe::-webkit-scrollbar {
  display: none;
}

/* ═══ Desktop Containment (laptop frame = 1252px viewport) ═══ */
/* Body stays full-width so desktop-nav spans edge to edge.
   Content areas are capped at a comfortable reading width. */
@media (min-width: 600px) {

  /* ── Content containment ── */
  /* Main scroll area — wide enough to use the full desktop viewport */
  body[data-screen] .flex-1.overflow-y-auto,
  body[data-screen] .flex-1.flex.flex-col {
    max-width: 1100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
    box-sizing: border-box !important;
  }

  /* Any direct-child div between nav and scroll area (filters, tabs) */
  body[data-screen] > div:not(.flex-1):not([class*="overflow"]) {
    max-width: 1100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
    box-sizing: border-box !important;
  }

  /* page-header containment */
  body[data-screen] page-header {
    max-width: 1100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
    box-sizing: border-box !important;
  }

  /* Bottom action bars */
  body[data-screen] .bg-surface-500.border-t {
    max-width: 1100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
    box-sizing: border-box !important;
    border-radius: 1rem 1rem 0 0;
  }

  /* ── Remove doubled padding: inner .px-5 sections already get scroll area padding ── */
  body[data-screen] .flex-1.overflow-y-auto > .px-5,
  body[data-screen] .flex-1.overflow-y-auto > div > .px-5 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* ── Login/Register: override scroll-area containment for split layout ── */
  body[data-screen="login"] .flex-1.flex.flex-col,
  body[data-screen="register"] .flex-1.overflow-y-auto {
    max-width: 900px !important;
    padding: 0 !important;
  }

  /* ── Per-screen width overrides ── */
  body[data-screen="landing"] .flex-1.overflow-y-auto       { max-width: 100% !important; padding: 0 !important; }
  body[data-screen="vehicle-detail"] .flex-1.overflow-y-auto { max-width: 1100px !important; }
  body[data-screen="auction-live"] .flex-1.overflow-y-auto   { max-width: 1100px !important; }
  body[data-screen="profile"] .flex-1.overflow-y-auto        { max-width: 900px !important; }
  body[data-screen="confirmation"] .flex-1.overflow-y-auto   { max-width: 700px !important; }
  body[data-screen="order-pipeline"] .flex-1.overflow-y-auto { max-width: 1000px !important; }
  body[data-screen="notifications"] .flex-1.overflow-y-auto  { max-width: 900px !important; }
  body[data-screen="verification-pending"] .flex-1.overflow-y-auto,
  body[data-screen="verification-pending"] .flex-1.relative   { max-width: 900px !important; }
  body[data-screen="kyb-upload"] .flex-1.overflow-y-auto      { max-width: 1000px !important; }
  body[data-screen="kyb-progress"] .flex-1.overflow-y-auto    { max-width: 1000px !important; }
  body[data-screen="kyb-rejected"] .flex-1.overflow-y-auto    { max-width: 900px !important; }

  /* ═══ Responsive Layouts — activate desktop grid wrappers ═══ */

  /* ── Home: desktop-card-grid (outer) + desktop-home-grid (inner) ── */
  body[data-screen="home"] .desktop-card-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }
  body[data-screen="home"] .desktop-card-grid > div,
  body[data-screen="home"] .desktop-card-grid > section-label,
  body[data-screen="home"] .desktop-card-grid > p,
  body[data-screen="home"] .desktop-card-grid > script {
    grid-column: 1 / -1 !important;
  }
  body[data-screen="home"] .desktop-home-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
    grid-column: 1 / -1 !important;
  }
  body[data-screen="home"] .desktop-home-grid > div,
  body[data-screen="home"] .desktop-home-grid > section-label {
    grid-column: 1 / -1 !important;
  }

  /* ── Search: vehicle cards in 3-column grid ── */
  body[data-screen="search"] .desktop-card-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.25rem !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body[data-screen="search"] .desktop-card-grid > div,
  body[data-screen="search"] .desktop-card-grid > section-label,
  body[data-screen="search"] .desktop-card-grid > p,
  body[data-screen="search"] .desktop-card-grid > button {
    grid-column: 1 / -1 !important;
  }
  /* Remove card bottom margins inside grids — gap handles spacing */
  body[data-screen="search"] .desktop-card-grid > a { margin-bottom: 0 !important; }
  body[data-screen="home"] .desktop-home-grid > a { margin-bottom: 0 !important; }
  body[data-screen="home"] .desktop-card-grid > .px-5 > a { margin-bottom: 0 !important; }

  /* ── Vehicle Detail: image left, info right ── */
  .desktop-two-col {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
    align-items: start !important;
  }
  .desktop-col-left {
    position: sticky !important;
    top: 0 !important;
  }
  .desktop-col-left .h-72 {
    height: 400px !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
  }
  .desktop-col-right .px-5 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* ── Checkout / Place Auction Order: form left, summary right ── */
  .desktop-checkout-grid {
    display: grid !important;
    grid-template-columns: 1fr 340px !important;
    gap: 2rem !important;
    align-items: start !important;
  }
  .desktop-checkout-right {
    position: sticky !important;
    top: 1rem !important;
  }

  /* ── My Orders: order cards in 2-column grid ── */
  .desktop-orders-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
  .desktop-orders-grid > section-label,
  .desktop-orders-grid > .mt-5 {
    grid-column: 1 / -1 !important;
  }
  .desktop-orders-grid > a { margin-bottom: 0 !important; }

  /* ── Home: horizontal scroll cards become a grid on desktop ── */
  body[data-screen="home"] .flex.gap-3.overflow-x-auto {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem !important;
    overflow: visible !important;
  }
  body[data-screen="home"] .flex.gap-3.overflow-x-auto > a {
    min-width: 0 !important;
  }

  /* ── KYB Progress: timeline left, documents right ── */
  .desktop-kyb-grid {
    display: grid !important;
    grid-template-columns: 1fr 380px !important;
    gap: 2rem !important;
    align-items: start !important;
  }
  .desktop-kyb-right {
    position: sticky !important;
    top: 0 !important;
  }

  /* ── KYB Upload: 2-column document cards ── */
  .desktop-upload-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }

  /* ── Notifications: 2-column notification cards ── */
  body[data-screen="notifications"] .space-y-2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  body[data-screen="notifications"] .space-y-2 > * {
    margin-top: 0 !important;
  }

  /* ── Profile: profile card + stats side by side ── */
  .desktop-profile-top {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    align-items: start !important;
  }

  /* ── Profile: settings sections in 2-column grid ── */
  .desktop-profile-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  .desktop-profile-grid > .mb-3,
  .desktop-profile-grid > section-label {
    grid-column: 1 / -1 !important;
  }

  /* ── Auction Live: vehicle+pricing left, bid feed right ── */
  .desktop-auction-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
    align-items: start !important;
  }
  .desktop-auction-left {
    position: sticky !important;
    top: 0 !important;
  }

  /* ── Order Pipeline: timeline left, details right ── */
  .desktop-pipeline-grid {
    display: grid !important;
    grid-template-columns: 1fr 380px !important;
    gap: 2rem !important;
    align-items: start !important;
  }
  .desktop-pipeline-right {
    position: sticky !important;
    top: 0 !important;
  }

  /* ── Confirmation: centered, narrower ── */
  body[data-screen="confirmation"] .flex-1.overflow-y-auto {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  body[data-screen="confirmation"] .flex-1.overflow-y-auto > * {
    width: 100% !important;
    max-width: 520px !important;
  }
}


/* ═══ UI Polish Improvements ═══ */

/* #2 — Subtle depth border on card components */
.bg-surface-400,
.bg-surface-300 {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* #4 — Smooth box-shadow transition on interactive cards */
a[class*="bg-surface-"],
button[class*="bg-surface-"],
div[class*="bg-surface-"][class*="rounded-"] {
  transition: box-shadow 300ms ease, background-color 200ms ease-out, transform 200ms ease-out;
}

/* Premium tap feedback on interactive card links (mobile-safe — no hover dependency) */
a[class*="bg-surface-"][class*="rounded-"]:active {
  transform: scale(0.98);
  opacity: 0.95;
}

/* #6 — Scale transform on hover for interactive cards (pointer devices only to avoid sticky hover on touch) */
@media (hover: hover) and (pointer: fine) {
  a[class*="bg-surface-"][class*="rounded-"]:hover {
    transform: scale(1.02);
  }
}
a[class*="bg-surface-"][class*="rounded-"],
button[class*="hover\\:bg-"] {
  will-change: transform;
}

/* #8 — Frosted glass on bottom sheet overlays */
.bg-surface-900\/95 {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* #14 — Inset shadow on text input fields for depth in dark theme */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="number"],
textarea {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

/* #16 — 200ms ease-out transition on all color changes for interactive elements */
a, button, input, [role="button"] {
  transition: color 200ms ease-out, background-color 200ms ease-out, border-color 200ms ease-out, box-shadow 200ms ease-out;
}

/* #17 — Consistent focus halo on card elements */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(56,189,248,0.3);
  border-radius: 9999px;
}

/* #18 — Softer divider lines between list items */
.border-neutral-800 {
  border-color: rgba(42, 48, 56, 0.5) !important;
}

/* #9 — Consistent shadow-glow on all primary accent action buttons */
button.bg-accent-400,
a.bg-accent-400,
[class*="bg-accent-400"]:is(button, a) {
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

/* #11 — Smooth transition between nested surface backgrounds */
[class*="bg-surface-400"] [class*="bg-surface-300"],
[class*="bg-surface-500"] [class*="bg-surface-400"] {
  background-image: linear-gradient(135deg, var(--color-surface-400), var(--color-surface-500));
}

/* #15 — Increase waveform container border-radius to match surrounding cards */
waveform-visual svg,
waveform-section svg {
  border-radius: 1.25rem;
}

/* #19 — Micro-animation for recording dot bounce */
@keyframes rec-dot-bounce {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}
.rec-dot {
  animation: rec-dot-bounce 1s ease-in-out infinite !important;
}
