/* Quick Connect PWA — light theme; white form fields */

:root {
  color-scheme: light only;
  --qc-input-bg: #ffffff;
  --qc-input-text: #0f172a;
  --qc-input-border: #e2e8f0;
}

html {
  min-height: 100%;
  min-height: 100dvh;
  background: #f8fafc;
  color-scheme: light only;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  background: #f8fafc;
  color: #0f172a;
}

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-block; }

#htmx-indicator.htmx-request {
  display: block;
  transform: scaleX(1);
  animation: qc-progress 1s ease-in-out infinite;
}

@keyframes qc-progress {
  0% { transform: scaleX(0.15); opacity: 0.7; }
  50% { transform: scaleX(0.7); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0.85; }
}

[x-cloak] { display: none !important; }

/* Force white inputs everywhere (overrides dark mode / autofill grey) */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
select,
textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0;
  -webkit-text-fill-color: #0f172a;
  caret-color: #0f172a;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.22);
  border-color: #14b8a6 !important;
}

/* Chrome autofill stays white */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #0f172a !important;
  transition: background-color 9999s ease-in-out 0s;
}

.glass-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 10px 28px -14px rgb(13 148 136 / 0.12);
}

.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.2s ease-in-out infinite;
}

@keyframes skeleton-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.htmx-added {
  animation: qc-fade-up 220ms ease both;
}

@keyframes qc-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Create/edit card: the document scrolls. Do not lock height or clip overflow. */
html.qc-editor-page {
  height: auto !important;
  max-height: none !important;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  color-scheme: light only;
}
html.qc-editor-page body {
  height: auto !important;
  max-height: none !important;
  min-height: 0;
  overflow: visible !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  color-scheme: light only;
}
html.qc-editor-page:has(.qc-editor-shell.is-preview) {
  overflow: hidden !important;
}
html.qc-editor-page .qc-app-frame,
html.qc-editor-page .qc-app-column,
html.qc-editor-page .qc-editor-main {
  height: auto !important;
  max-height: none !important;
  min-height: 0;
  overflow: visible !important;
}
html.qc-editor-page .qc-app-frame {
  display: block;
}
html.qc-editor-page .qc-app-column {
  display: block;
  width: 100%;
  flex: none;
}
html.qc-editor-page .qc-editor-main {
  display: block;
  flex: none;
}
@media (min-width: 1024px) {
  html.qc-editor-page .qc-app-frame {
    display: flex;
    align-items: flex-start;
  }
  html.qc-editor-page .qc-app-column {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }
  html.qc-editor-page #app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    flex-shrink: 0;
  }
}

.qc-editor-shell {
  position: relative;
  background: #f8fafc;
  color: #0f172a;
  padding-bottom: 5.75rem;
}
.qc-editor-header,
.qc-preview-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem 0.75rem;
}
.qc-editor-scroll > section {
  scroll-margin-top: 4.75rem;
}
.qc-editor-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.75rem 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgb(15 23 42 / 0.08);
}
@media (min-width: 1024px) {
  .qc-editor-actions {
    left: 16rem;
  }
  body.sidebar-collapsed .qc-editor-actions {
    left: 4.5rem;
  }
}
.qc-editor-shell.is-preview .qc-editor-actions {
  display: none;
}

.qc-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  background: #f8fafc;
}
.qc-editor-shell.is-preview .qc-preview-overlay {
  display: flex;
}
.qc-preview-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.qc-preview-shell {
  --dc-page: #f3faf9;
  --dc-surface: #ffffff;
  --dc-ink: #0f172a;
  --dc-muted: #334155;
  --dc-border: rgba(15, 23, 42, 0.08);
  --dc-accent: #0d9488;
  --dc-radius: 16px;
  background: var(--dc-page);
  color: var(--dc-ink);
}
.qc-preview-shell .dc-section {
  border: 1px solid var(--dc-border);
  background: var(--dc-surface);
  border-radius: max(var(--dc-radius), 14px);
  padding: 1.25rem;
}
.qc-preview-shell .dc-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  min-height: 4.25rem;
  padding: 0.75rem 0.5rem;
  border-radius: max(var(--dc-radius), 14px);
  border: 1px solid var(--dc-border);
  background: var(--dc-surface);
  color: var(--dc-ink);
}

@media (prefers-reduced-motion: reduce) {
  .qc-preview-overlay {
    transition: none;
  }
}

.qc-upload-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.qc-upload-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.qc-upload-tile {
  position: relative;
  display: flex;
  overflow: hidden;
  cursor: pointer;
  border: 1.5px dashed #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.qc-upload-cover {
  min-height: 7.5rem;
  border-radius: 1rem;
}
.qc-upload-photo,
.qc-upload-logo {
  min-height: 8.25rem;
  border-radius: 1rem;
}
.qc-upload-tile:hover,
.qc-upload-tile:focus-within {
  border-color: #14b8a6;
  background: #f0fdfa;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}
.qc-upload-tile.has-image {
  border-style: solid;
  border-color: #e2e8f0;
  background: #0f172a;
}
.qc-upload-tile.has-image:hover,
.qc-upload-tile.has-image:focus-within {
  border-color: #14b8a6;
}
.qc-upload-tile input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.qc-upload-tile input[type="file"]:focus {
  box-shadow: none !important;
}
.qc-upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  padding: 0.85rem 0.6rem;
  text-align: center;
}
.qc-upload-tile.has-image .qc-upload-empty {
  display: none;
}
.qc-upload-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: #0f766e;
}
.qc-upload-title {
  font-size: 0.875rem;
  font-weight: 650;
  color: #0f172a;
}
.qc-upload-hint {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  color: #334155;
}
.qc-upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.qc-upload-preview-contain {
  object-fit: contain;
  background: #ffffff;
  padding: 0.75rem;
}
.qc-upload-change {
  display: none;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0.4rem 0.5rem;
  background: linear-gradient(to top, rgb(15 23 42 / 0.78), rgb(15 23 42 / 0.12));
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 650;
  text-align: center;
}
.qc-upload-tile.has-image .qc-upload-change {
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .qc-upload-tile {
    transition: none;
  }
}
