:root {
  --bg: #eef2f8;
  --surface: #ffffff;
  --text: #1a2332;
  --text-muted: #5a6578;
  --border: #c8d6e8;
  --border-strong: #9eb4d0;
  --primary: #0a5ea8;
  --primary-hover: #084a86;
  --primary-soft: #e8f1fb;
  --success: #0a7a39;
  --danger: #b3261e;
  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 4px 14px rgba(8, 51, 88, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --tap-min: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px));
}

h1 {
  margin: 0 0 10px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #052f53;
}

.subtitle {
  margin: 0 0 20px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.subtitle strong {
  color: #083358;
}

.adm-third-card-line {
  margin-top: 6px;
  margin-bottom: 18px;
}

.adm-third-card-line #admThirdCardTitle {
  font-weight: 600;
  color: #0a5ea8;
}

.adm-pack-hint {
  margin-top: -12px;
  margin-bottom: 18px;
  font-size: 0.85rem;
}

.adm-pack-hint code {
  font-size: 0.88em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.card--login {
  border-color: #bcd0e6;
}

.card--toolbar {
  padding: 12px 16px;
}

.card-heading {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 800;
  color: #052f53;
}

.card-lead {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 500;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #2d3a4d;
}

#loginForm label:first-of-type,
#manualForm > label:first-of-type {
  margin-top: 0;
}

.card .card-lead + label {
  margin-top: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: #fafbfd;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8a93a3;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(10, 94, 168, 0.2);
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap-min);
  margin-top: 12px;
  padding: 12px 16px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  margin-top: 16px;
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary--large {
  min-height: 52px;
  font-size: 1rem;
}

.btn-secondary {
  margin-top: 10px;
  background: #e8f0f8;
  color: #083358;
  border-color: #bcd0e6;
}

.btn-secondary:hover:not(:disabled) {
  background: #dce8f4;
}

.btn-outline {
  margin-top: 10px;
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-soft);
}

.btn-ghost {
  margin-top: 0;
  min-height: 44px;
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: #f0f4f9;
  color: var(--text);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 94, 168, 0.35);
}

.status {
  margin: 12px 0 0;
  min-height: 22px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.35;
}

.status-inline {
  margin: 8px 0 4px;
  min-height: 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field-group-price {
  margin: 18px 0 8px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #f0f7ff 0%, #e8f2fc 100%);
  border: 1px solid #b8d4f0;
}

.field-group-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #052f53;
}

.field-hint {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted);
  font-weight: 500;
}

.field-group-price label {
  margin-top: 0;
}

.field-group-price input {
  font-size: 1.08rem;
  font-weight: 800;
  color: #00a650;
  background: #fff;
}

.field-group-files {
  margin: 18px 0 8px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #fafbfd;
  border: 1px solid var(--border);
}

.field-group-files > label:first-of-type {
  margin-top: 0;
}

.field-group-files .label-pdf {
  margin-top: 16px;
}

.file-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.file-pick-row .btn {
  margin-top: 0;
}

.file-input-native {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.manuals-edit-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manual-edit-row {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fafbfd;
}

.manual-edit-row__title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #052f53;
  line-height: 1.3;
}

.manual-edit-row__id {
  display: block;
  margin-bottom: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  word-break: break-all;
}

.manual-edit-thumb {
  display: block;
  width: 100%;
  max-width: 120px;
  height: auto;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.manual-edit-row label {
  margin-top: 0;
  font-size: 0.82rem;
}

.manual-edit-row .manual-edit-category {
  margin-top: 4px;
  margin-bottom: 8px;
}

.manual-edit-row .btn.manual-edit-save {
  margin-top: 10px;
}

.field-block {
  margin-bottom: 10px;
}

.field-block label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 4px;
  color: var(--text-muted, #4f5e6d);
}

.field-block input[type="text"],
.field-block input[type="number"],
.field-block textarea {
  width: 100%;
  box-sizing: border-box;
}

.pro-intro-editor {
  width: 100%;
  box-sizing: border-box;
  min-height: 88px;
}

.pro-cards-editor-mount {
  margin-top: 12px;
}

.pro-card-editor {
  margin-bottom: 12px;
  border: 1px solid var(--border, #e3e7ee);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface, #f7f9fc);
}

.pro-card-editor summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.pro-card-editor__html {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
}

/* Conteudo Pro ADM: preview como no Colinha (layout + scroll do corpo) */
.pro-card-adm-section {
  margin-bottom: 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}

.pro-card-adm-preview {
  padding: 12px 14px;
  background: var(--surface, #f7f9fc);
  border-bottom: 1px solid var(--border, #e3e7ee);
}

.adm-pro-preview-label {
  margin: 0 0 10px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
}

.adm-pro-card-preview {
  margin: 0;
}

.adm-pro-price-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #4a5568;
}

.adm-pro-price-note code {
  font-size: 0.76rem;
  word-break: break-all;
}

.adm-pro-price-strong {
  font-weight: 800;
  color: #00a650;
  font-size: 1.15rem;
}

.adm-pro-body-preview {
  max-height: 300px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px !important;
  padding-top: 12px !important;
}

.adm-pro-intro-preview {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed #cbd5e0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #2d3748;
  background: #fafbfc;
}

.adm-pro-section-h3 {
  margin: 16px 0 8px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #083358;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.adm-pro-section-h3:first-of-type {
  margin-top: 0;
}

.adm-pro-field-hint {
  margin: 0 0 6px;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.adm-pro-fake-gate {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.adm-pro-fake-gate .pro-card-unlock-btn {
  pointer-events: none;
  user-select: none;
}

.adm-pro-fake-gate--free {
  text-align: center;
}

.adm-pro-price-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.adm-pro-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fafbfc;
}

.adm-pro-price-row__name {
  flex: 1 1 200px;
  font-weight: 700;
  font-size: 1rem;
  color: #083358;
  line-height: 1.35;
}

.adm-pro-price-row__field {
  flex: 0 1 140px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adm-pro-price-row__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.adm-pro-price-row__input {
  width: 100%;
  max-width: 160px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e0;
  font-size: 1rem;
}

.adm-pro-price-row__save {
  flex: 0 0 auto;
  align-self: flex-end;
  min-width: 100px;
}

.adm-pro-price-row__avail {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  min-height: 42px;
}

.adm-pro-price-row__avail-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  user-select: none;
}

.adm-pro-price-row__unavailable {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.adm-pro-price-row--unavailable {
  border-color: #f0c9c9;
  background: #fff8f8;
}

.adm-pro-price-row--unavailable .adm-pro-price-row__name {
  color: #8b3a3a;
  text-decoration: line-through;
  text-decoration-color: rgba(139, 58, 58, 0.45);
}

/* Se conteudopro-page.css nao carregar (caminho relativo), mantem cabecalho do card legivel */
.pro-card-adm-section .pro-card-inner {
  padding: 14px 14px 12px;
}

.pro-card-adm-section .pro-card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 4px;
  align-items: start;
}

.pro-card-adm-section .pro-card-icon-lock {
  grid-row: 1 / span 2;
  font-size: 1.75rem;
  color: #3ddc84;
  line-height: 1;
}

.pro-card-adm-section .pro-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #1a202c;
}

.pro-card-adm-section .pro-card-teaser {
  grid-column: 2;
  margin: 0;
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.35;
}

.pro-card-adm-section .pro-card-content {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #2d3748;
}

.adm-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-top: 1px solid #e3e7ee;
  border-radius: 16px 16px 0 0;
  background: #ffffff;
  box-shadow: 0 -4px 20px rgba(18, 30, 52, 0.12);
  z-index: 1200;
}

.adm-tabbar__item {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  min-height: 54px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #7f8794;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.68rem;
  line-height: 1.1;
  text-align: center;
}

.adm-tabbar__item:active {
  transform: scale(0.98);
}

.adm-tabbar__icon {
  flex-shrink: 0;
  font-size: 1.28rem;
  line-height: 1;
}

.material-symbols-outlined.adm-tabbar__icon {
  font-variation-settings:
    "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

.adm-tabbar__label {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-tabbar__item--active {
  color: #0a5ea8;
  background: var(--primary-soft, #e8f1fb);
}

@media (max-width: 380px) {
  .container {
    padding: 16px 12px calc(92px + env(safe-area-inset-bottom, 0px));
  }

  h1 {
    font-size: 1.35rem;
  }

  .adm-tabbar__item {
    font-size: 0.62rem;
    min-height: 50px;
  }

  .adm-tabbar__icon {
    font-size: 1.2rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #1a1f28;
    --text: #e8eaed;
    --text-muted: #9aa3b2;
    --border: #2c3544;
    --border-strong: #3d4a5c;
    --primary-soft: #1e2d3d;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  }

  h1,
  .card-heading,
  .field-group-title {
    color: #e3edf8;
  }

  .subtitle strong {
    color: #9bc5ff;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="number"],
  select,
  textarea {
    background: #12161d;
    color: var(--text);
    border-color: var(--border);
  }

  input:focus,
  textarea:focus {
    background: #151a22;
    box-shadow: 0 0 0 3px rgba(47, 143, 237, 0.25);
  }

  .btn-secondary {
    background: #252b36;
    color: #c5daf3;
    border-color: #3d4f66;
  }

  .btn-outline {
    background: transparent;
    color: #6ea8ff;
    border-color: #4a7dc4;
  }

  .btn-outline:hover:not(:disabled) {
    background: #1e2836;
  }

  .btn-ghost {
    border-color: var(--border);
    color: var(--text-muted);
  }

  .btn-ghost:hover:not(:disabled) {
    background: #222831;
    color: var(--text);
  }

  .field-group-price {
    background: linear-gradient(180deg, #1a2431 0%, #15202d 100%);
    border-color: #2f4a62;
  }

  .field-group-price input {
    background: #121820;
    color: #3ddc84;
  }

  .field-group-files {
    background: #161b22;
    border-color: var(--border);
  }

  .file-input-native {
    background: #12161d;
    color: var(--text);
    border-color: var(--border-strong);
  }

  .manual-edit-row {
    background: #121820;
    border-color: var(--border);
  }

  .manual-edit-row__title {
    color: #e3edf8;
  }

  .manual-edit-row .manual-edit-price {
    color: #3ddc84;
  }

  .adm-tabbar {
    background: rgba(16, 21, 30, 0.96);
    border-color: var(--border);
  }

  .adm-tabbar__item {
    color: #9fa9b8;
  }

  .adm-tabbar__item--active {
    color: #7ec8ff;
    background: rgba(10, 94, 168, 0.22);
  }
}
