/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf0f3;
  --surface: #fef5f8;
  --surface-alt: #fff;
  --text: #1f1f28;
  --text-secondary: #4a4a58;
  --text-muted: #6b7280;
  --rose: #d4567e;
  --rose-deep: #b8426a;
  --rose-glow: rgba(212, 86, 126, 0.12);
  --rose-glow-strong: rgba(212, 86, 126, 0.25);
  --teal: #0f6b7c;
  --teal-glow: rgba(15, 107, 124, 0.10);
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow: 0 8px 32px rgba(0,0,0,0.07);
  --radius: 16px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text); background: var(--bg);
  line-height: 1.6; min-height: 100vh;
  transition: background 0.5s ease, color 0.5s ease;
  padding-top: 48px;
}
/* Theme transitions only on interactive elements (not global * which hurts performance) */
.tab-btn, .gen-btn, .form-field input, .form-field textarea, .form-field select,
.card, .plan-card, .chip { transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease; }

/* ===== HEADER (compact single-line) ===== */
.app-header {
  background: linear-gradient(135deg, var(--rose), var(--teal));
  color: #fff; padding: 0 24px; height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
}
.header-brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.header-brand h1, .header-brand-name { font-size: 18px; font-weight: 700; white-space: nowrap; }
.header-brand span { font-size: 12px; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.ai-header-indicator {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.12); border-radius: 6px; padding: 3px 10px;
  font-size: 11px; color: rgba(255,255,255,0.85); font-weight: 500;
}
.ai-header-icon { color: rgba(255,255,255,0.85); flex-shrink: 0; display: block; }
.ai-header-indicator .ai-key-status { width: 7px; height: 7px; }
.ai-header-btn {
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; padding: 4px 12px; border-radius: 6px; font-size: 11px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.ai-header-btn:hover { background: rgba(255,255,255,0.3); }
.ai-header-key {
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; padding: 4px 8px; border-radius: 6px; font-size: 11px;
  width: 140px; font-family: inherit;
}
.ai-header-key::placeholder { color: rgba(255,255,255,0.45); }
.ai-header-msg { font-size: 10px; color: rgba(255,255,255,0.7); white-space: nowrap; }
.header-save-group {
  display: flex; align-items: center; gap: 4px;
}
.header-save-btn {
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; padding: 4px 12px; border-radius: 6px; font-size: 11px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.header-save-btn:hover { background: rgba(255,255,255,0.3); }
/* Header plan badge */
.header-plan-badge {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.15); border-radius: 6px; padding: 3px 10px;
  font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap;
  cursor: pointer; transition: background 0.2s;
}
.header-plan-badge:hover { background: rgba(255,255,255,0.25); }
.ai-header-count {
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px; color: rgba(255,255,255,0.9); white-space: nowrap;
}
.ai-header-count.warn { color: #fbbf24; }
.ai-header-count.critical { color: #f87171; }
.header-plan-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.5);
}
.header-plan-dot.free { background: rgba(255,255,255,0.5); }
.header-plan-dot.basic { background: #fbbf24; }
.header-plan-dot.pro { background: #34d399; }
/* Payment card features — legacy removed, now in .pay-card-features */

/* ===== LAYOUT ===== */
.app-container {
  max-width: 1600px; margin: 0 auto; padding: 14px;
  display: flex; gap: 18px; align-items: flex-start;
}
.form-panel {
  flex: 0 0 60%; max-width: 60%; min-width: 0;
}
.preview-panel {
  flex: 0 0 calc(40% - 18px); max-width: calc(40% - 18px);
  position: sticky; top: 62px;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  height: calc(100vh - 76px);
}
.preview-panel-header {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.preview-panel-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.preview-panel-header-row h3 {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin: 0;
}
.preview-panel-toggle {
  display: flex; gap: 0;
  border: 1px solid var(--border); border-radius: 5px; overflow: hidden;
}
.preview-panel-toggle button {
  padding: 4px 14px; border: none; background: transparent;
  font-size: 10.5px; font-weight: 700; cursor: pointer; font-family: inherit;
  color: var(--text-muted); transition: all 0.2s; letter-spacing: 0.3px;
}
.preview-panel-toggle button:first-child { border-right: 1px solid var(--border); }
.preview-panel-toggle button.active-criativo {
  background: var(--rose); color: #fff;
}
.preview-panel-toggle button.active-europass {
  background: #004494; color: #fff;
}
.preview-panel-tabs-row {
  display: flex; align-items: center; gap: 6px;
}
.preview-panel-tabs {
  display: flex; flex-wrap: wrap; gap: 4px; flex: 1; justify-content: flex-end;
}
.panel-viewport-toggle {
  display: flex; gap: 2px; background: var(--border, #e5e5e5); border-radius: 6px; padding: 2px; flex-shrink: 0;
}
.preview-panel-tab {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 5px;
  background: transparent; color: var(--text-muted); font-size: 11px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
  white-space: nowrap;
}
.preview-panel-tab:hover { color: var(--rose); border-color: var(--rose); background: var(--rose-glow); }
.preview-panel-tab.active {
  background: var(--rose); color: #fff; border-color: var(--rose);
}
.preview-panel.europass .preview-panel-tab:hover { color: #004494; border-color: #004494; background: rgba(0,68,148,0.06); }
.preview-panel.europass .preview-panel-tab.active {
  background: #004494; color: #fff; border-color: #004494;
}
.preview-panel-body {
  flex: 1; position: relative; overflow: hidden;
  background: #e8e8e8;
}
.preview-panel-body iframe {
  width: 100%; height: 100%; border: none; display: none;
  background: #fff;
}
.preview-panel-body iframe.active { display: block; }
/* Panel viewport modes */
.preview-panel-body.panel-desktop-view {
  overflow: auto;
}
.preview-panel-body.panel-desktop-view iframe {
  width: 1024px; transform-origin: top left;
  /* scale and height set dynamically via JS */
}
.preview-panel-body.panel-mobile-view {
  overflow-y: auto; overflow-x: hidden;
  display: flex; justify-content: center; background: #d5d5d5;
}
.preview-panel-body.panel-mobile-view iframe {
  width: 390px; min-height: 100%; flex-shrink: 0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12); background: #fff;
}
.preview-panel-loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: var(--text-muted); font-size: 13px; text-align: center;
}
.preview-panel-loading .spinner {
  display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--rose); border-radius: 50%; animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.preview-panel-footer {
  padding: 8px 16px; border-top: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
  display: flex; justify-content: flex-end; gap: 8px;
}
.preview-download-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-alt); color: var(--teal); font-size: 11px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.preview-download-btn:hover { background: var(--teal-glow); border-color: var(--teal); }
.preview-empty-msg {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px;
}
.preview-empty-msg p { margin-top: 8px; font-size: 11px; opacity: 0.7; }

/* Mobile preview button (hidden on desktop) */
.mobile-preview-btn {
  display: none; position: fixed; bottom: 20px; right: 20px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--teal));
  color: #fff; border: none; font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25); z-index: 999;
  align-items: center; justify-content: center;
}
.mobile-preview-btn:hover { transform: scale(1.1); }

/* ===== TABS ===== */
.tabs {
  display: flex; flex-wrap: nowrap; gap: 3px;
  background: var(--surface); border-radius: var(--radius);
  padding: 4px; margin-bottom: 12px; border: 1px solid var(--border);
  position: sticky; top: 48px; z-index: 199;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.tab-btn {
  flex: 1 1 0; min-width: 0; padding: 8px 6px;
  border: none; background: transparent; border-radius: var(--radius-sm);
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s;
  font-family: inherit; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.tab-btn:hover { color: var(--rose); background: var(--rose-glow); }
.tab-btn.active {
  background: var(--rose); color: #fff;
  box-shadow: 0 2px 8px rgba(212,86,126,0.3);
}
.tab-btn { position: relative; }
.tab-progress-dot {
  position: absolute; top: 4px; right: 4px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal); opacity: 0.8;
}
.tab-btn.active .tab-progress-dot { background: #fff; }
.tab-separator {
  width: 1px; align-self: stretch; background: var(--border);
  margin: 4px 2px; flex-shrink: 0; opacity: 0.6;
}
.tab-btn-action {
  flex: 0 1 auto; padding: 8px 14px;
}
.tab-btn-gerar:hover { color: var(--teal); background: var(--teal-glow); }
.tab-btn-gerar.active {
  background: var(--teal); color: #fff;
  box-shadow: 0 2px 8px rgba(0,172,168,0.3);
}
.tab-btn-planos:hover { color: #7c3aed; background: rgba(124,58,237,0.08); }
.tab-btn-planos.active {
  background: #7c3aed; color: #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,0.3);
}
.tab-btn-conta:hover { color: var(--rose); background: rgba(219,39,119,0.08); }
.tab-btn-conta.active {
  background: var(--rose); color: #fff;
  box-shadow: 0 2px 8px rgba(219,39,119,0.3);
}
.tab-btn-candidatura:hover { color: #b8860b; background: rgba(184,134,11,0.08); }
.tab-btn-candidatura.active {
  background: #b8860b; color: #fff;
  box-shadow: 0 2px 8px rgba(184,134,11,0.3);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
#tab-candidatura.active {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; align-items: start;
}
#tab-candidatura .form-section { margin-bottom: 0; }
.btn-gen {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; font-size: 13px; font-weight: 600;
  font-family: inherit; border-radius: 8px; cursor: pointer;
  transition: all 0.2s; border: 1.5px solid #b8860b;
  background: #b8860b; color: #fff;
}
.btn-gen:hover {
  background: #9a7209; border-color: #9a7209;
  box-shadow: 0 2px 8px rgba(184,134,11,0.3);
}
.btn-gen:active { transform: scale(0.97); }
.btn-gen:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
  box-shadow: none;
}

/* ===== FORM SECTIONS ===== */
.form-section {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.form-section h3 {
  font-size: 15px; font-weight: 700; color: var(--rose);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.form-section h3::before {
  content: ''; display: block; width: 4px; height: 18px;
  background: linear-gradient(180deg, var(--rose), var(--teal));
  border-radius: 4px;
}

/* ===== FORM FIELDS ===== */
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 12px;
}
.form-row.single { grid-template-columns: 1fr; }
.form-row.triple { grid-template-columns: 1fr 1fr 1fr; }
.form-row.quad { grid-template-columns: 1fr 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  letter-spacing: 0.3px;
}
.form-group input,
.form-group textarea,
.form-group select {
  padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px;
  font-family: inherit; color: var(--text);
  background: var(--surface); transition: all 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none; border-color: var(--rose);
  box-shadow: 0 0 0 3px var(--rose-glow);
}
.form-group.required > label::after { content: ' *'; color: var(--rose); font-weight: 700; }
.form-group.required input,
.form-group.required textarea,
.form-group.required select {
  border-left: 3px solid var(--rose);
}
.form-group.required.filled input,
.form-group.required.filled textarea,
.form-group.required.filled select {
  border-left: 3px solid #34c759;
}
.form-group.field-error input,
.form-group.field-error textarea {
  border-color: #dc2626; border-left: 3px solid #dc2626; background: rgba(220,38,38,0.03);
}
.form-group textarea { resize: vertical; min-height: 80px; }

.form-group input[type="color"] {
  padding: 4px; height: 42px; cursor: pointer;
}
.form-group input[type="file"] {
  padding: 8px; font-size: 13px;
}

.form-hint {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
}

/* ===== PERSONAL INFO GRID (photo left, fields right) ===== */
.personal-info-grid {
  display: flex; gap: 16px; align-items: flex-start;
}
.personal-info-grid .photo-column {
  flex-shrink: 0; width: 140px;
}
.personal-info-grid .fields-column {
  flex: 1; min-width: 0;
}
.personal-info-grid .fields-column .form-row {
  margin-bottom: 10px;
}
.personal-info-grid .fields-column .form-row:last-child {
  margin-bottom: 0;
}
.personal-info-grid .fields-column .form-group label {
  margin-bottom: 2px; font-size: 10.5px;
}
.personal-info-grid .fields-column .form-group input,
.personal-info-grid .fields-column .form-group select {
  padding: 6px 10px; font-size: 12.5px;
}

/* ===== PHOTO UPLOAD & EDITOR ===== */
.photo-upload-area {
  display: flex; align-items: flex-start; gap: 20px; margin-bottom: 0;
}
.photo-drop-zone {
  width: 130px; height: 130px; border-radius: var(--radius-sm);
  border: 2px dashed var(--border); display: grid; place-items: center;
  background: var(--surface); cursor: pointer; flex-shrink: 0;
  transition: all 0.25s ease; position: relative; overflow: hidden;
}
.photo-drop-zone:hover { border-color: var(--rose); background: var(--rose-glow); }
.photo-drop-zone.has-photo { border-style: solid; cursor: default; }
.photo-drop-zone .drop-placeholder {
  text-align: center; font-size: 11px; color: var(--text-muted); padding: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.photo-drop-zone .drop-placeholder .drop-icon { font-size: 28px; opacity: 0.4; }
.photo-editor-card {
  display: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-top: 12px;
}
.photo-editor-card.visible { display: block; }
.photo-editor-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.photo-editor-header h4 {
  font-size: 12px; font-weight: 700; color: var(--text);
  margin: 0; text-transform: uppercase; letter-spacing: 0.8px;
}
.shape-selector { display: flex; gap: 4px; }
.shape-btn {
  padding: 4px 10px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface-alt);
  cursor: pointer; font-size: 11px; font-weight: 600;
  color: var(--text-muted); font-family: inherit; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 4px;
}
.shape-btn:hover { border-color: var(--rose); color: var(--rose); }
.shape-btn.active { border-color: var(--rose); background: var(--rose-glow); color: var(--rose); }
.shape-btn .shape-icon { font-size: 14px; }
.crop-area {
  position: relative; width: 280px; height: 280px; margin: 0 auto 10px;
  background: #111; border-radius: var(--radius-sm); overflow: hidden;
  cursor: grab; touch-action: none; user-select: none;
}
.crop-area:active { cursor: grabbing; }
.crop-area canvas { display: block; width: 100%; height: 100%; }
.crop-mask {
  position: absolute; inset: 0; pointer-events: none;
}
.zoom-info-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.zoom-info-row label { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.zoom-info-row input[type="range"] {
  flex: 1; height: 5px; -webkit-appearance: none; appearance: none;
  background: var(--border); border-radius: 3px; outline: none;
}
.zoom-info-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--rose); cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.zoom-info-row .photo-info { font-size: 10px; color: var(--text-muted); white-space: nowrap; margin: 0; }
.photo-change-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px;
  font-size: 11px; color: var(--rose); font-weight: 600; cursor: pointer;
  background: none; border: none; font-family: inherit; padding: 0;
}
.photo-change-btn:hover { text-decoration: underline; }
#photoConfirmBtn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(212,86,126,0.4); }
#photoEditBtn:hover { text-decoration: underline; }

/* ===== DYNAMIC LISTS (Experience, Education) ===== */
.dynamic-list { display: flex; flex-direction: column; gap: 16px; }
.dynamic-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px;
  position: relative;
}
.dynamic-item .remove-btn {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(220,38,38,0.1); color: #dc2626;
  cursor: pointer; font-size: 16px; font-weight: 700;
  display: grid; place-items: center; transition: all 0.2s;
}
.dynamic-item .remove-btn:hover {
  background: #dc2626; color: #fff;
}
.add-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border: 2px dashed var(--border);
  border-radius: var(--radius-sm); background: transparent;
  color: var(--rose); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.add-btn:hover {
  border-color: var(--rose); background: var(--rose-glow);
}

/* ===== SKILL ITEMS ===== */
.skill-entry {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px;
  align-items: end; margin-bottom: 10px;
}
.skill-entry .remove-skill {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: none; background: rgba(220,38,38,0.1); color: #dc2626;
  cursor: pointer; font-size: 14px; display: grid; place-items: center;
}

/* ===== CHIPS INPUT ===== */
.chips-container {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--teal-glow); color: var(--teal);
  font-size: 13px; font-weight: 500;
}
.chip .remove-chip {
  width: 16px; height: 16px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.1); color: inherit;
  cursor: pointer; font-size: 10px; display: grid; place-items: center;
  line-height: 1;
}
.chip-input-row {
  display: flex; gap: 8px; margin-top: 8px; align-items: center;
}
.chip-input-row input { flex: 1; }
.chip-input-row button#addChip {
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  background: var(--teal); color: #fff; font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: inherit;
}
.chip-input-row .chip-translate-btn {
  margin-bottom: 0; flex-shrink: 0;
}

/* ===== GENERATE SECTION ===== */
.generate-section {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-top: 14px;
}
.generate-section h3 {
  font-size: 14px; font-weight: 700; margin-bottom: 3px; color: var(--text);
}
.generate-section > p {
  font-size: 11px; color: var(--text-muted); margin-bottom: 14px;
}
/* ===== PUBLISH SECTION (inside tab-gerar) ===== */
.publish-section {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-top: 14px;
}
.publish-section h3 {
  font-size: 14px; font-weight: 700; margin-bottom: 3px; color: var(--rose);
}
.publish-section > p {
  font-size: 11px; color: var(--text-muted); margin-bottom: 14px;
}
.gen-group { margin-bottom: 16px; }
.gen-group:last-child { margin-bottom: 0; }
.gen-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.gen-group-label.criativo { color: var(--rose); }
.gen-group-label.europass { color: #004494; }
.generate-btns {
  display: flex; flex-wrap: wrap; gap: 8px;
}
/* Criativo buttons — outlined, subtle */
.gen-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.gen-btn-criativo {
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.gen-btn-criativo:hover {
  border-color: var(--rose); color: var(--rose); background: var(--rose-glow);
}
/* Europass buttons — outlined, blue accent */
.gen-btn-europass {
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.gen-btn-europass:hover {
  border-color: #004494; color: #004494; background: rgba(0,68,148,0.06);
}
.gen-group-label.candidatura { color: #b8860b; }
.gen-btn-candidatura {
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.gen-btn-candidatura:hover {
  border-color: #b8860b; color: #b8860b; background: rgba(184,134,11,0.06);
}

/* ===== BILINGUAL FIELD ===== */
.bilingual {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.bilingual .lang-label {
  font-size: 11px; font-weight: 700; color: var(--rose);
  margin-bottom: 0; display: block;
}
.bilingual .form-group {
  display: grid; grid-template-columns: auto 1fr;
  align-items: center; gap: 2px 8px;
}
.bilingual .form-group input,
.bilingual .form-group textarea,
.bilingual .form-group select {
  grid-column: 1 / -1;
}
.bilingual .form-group .ai-bar {
  margin-bottom: 0; justify-self: start;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .app-container { flex-direction: column; }
  .form-panel { flex: 1; max-width: 100%; }
  .preview-panel { display: none; }
  .mobile-preview-btn { display: flex; }
}
@media (max-width: 768px) {
  .form-row, .form-row.triple, .form-row.quad { grid-template-columns: 1fr; }
  .bilingual { grid-template-columns: 1fr; }
  #tab-candidatura.active { grid-template-columns: 1fr; }
  .tabs {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; gap: 2px; padding: 3px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { min-width: auto; flex: 0 0 auto; padding: 10px 12px; font-size: 11px; }
  .tab-separator { display: none; }
  .tab-btn-action { padding: 10px 14px; }
  .generate-btns { flex-direction: column; align-items: center; }
  .gen-btn { width: 100%; justify-content: center; min-height: 44px; }
  .form-field input, .form-field textarea, .form-field select { min-height: 44px; font-size: 16px; }
  .personal-info-grid { flex-direction: column; }
  .personal-info-grid .photo-column { width: 100%; }
  .photo-upload-area { flex-direction: column; align-items: stretch; }
  .photo-drop-zone { width: 100%; height: 100px; }
  .crop-area { width: 160px; height: 160px; }
  .skill-entry { grid-template-columns: 1fr; }
  body { padding-top: 0; }
  .app-header { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 8px; position: relative; }
  .header-brand span { display: none; }
  .ai-header-key { width: 100px; }
  .header-save-btn span { display: none; }
  .tabs { top: 0; position: relative; }
}

/* ===== BULLET LIST TEXTAREA HINT ===== */
.bullet-hint { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* ===== DEMO BUTTON ===== */
.demo-btn {
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3);
  color: #fff; padding: 5px 16px; border-radius: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
  letter-spacing: 0.3px; white-space: nowrap;
  transition: all 0.2s;
}
.demo-btn:hover { background: rgba(255,255,255,0.3); }

/* ===== PREVIEW MODAL ===== */
.preview-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); z-index: 9999; justify-content: center; align-items: center;
  backdrop-filter: blur(4px);
}
.preview-overlay.active { display: flex; }
.preview-modal {
  background: var(--surface, #fff); border-radius: 16px;
  width: 94vw; max-width: 1100px; height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transition: max-width 0.3s ease;
}
.preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface-alt, #fafafa); flex-shrink: 0;
}
.preview-header h3 { font-size: 15px; color: var(--text); }
.preview-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--text-muted); padding: 4px 8px; border-radius: 6px;
  line-height: 1; font-family: inherit;
}
.preview-close:hover { background: var(--border); color: var(--text); }
.preview-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  overflow-x: auto; flex-shrink: 0; background: var(--surface-alt, #fafafa);
  padding: 0 12px;
}
.preview-tab {
  padding: 8px 14px; font-size: 11px; font-weight: 600; cursor: pointer;
  border: none; background: none; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; font-family: inherit; transition: color 0.2s;
}
.preview-tab.active { color: var(--rose); border-bottom-color: var(--rose); }
.preview-tab:hover:not(.active) { color: var(--text-secondary); }
.preview-body { flex: 1; position: relative; overflow: hidden; background: #e8e8e8; }
.preview-body iframe {
  width: 100%; height: 100%; border: none; position: absolute;
  top: 0; left: 0;
}
.preview-body iframe.hidden { display: none; }
.preview-loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: var(--text-muted); font-size: 14px;
}

/* Viewport toggle */
.preview-viewport-toggle {
  display: flex; gap: 2px; background: var(--border, #e5e5e5); border-radius: 8px; padding: 2px;
}
.pvt-btn {
  display: grid; place-items: center; width: 32px; height: 28px; border: none;
  background: transparent; border-radius: 6px; cursor: pointer;
  color: var(--text-muted, #999); transition: all 0.2s ease;
}
.pvt-btn:hover { color: var(--text, #333); }
.pvt-btn.active { background: var(--surface, #fff); color: var(--rose, #d4577d); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
/* Mobile preview */
.preview-body.mobile-view { display: flex; justify-content: center; align-items: flex-start; background: var(--border, #e5e5e5); overflow: auto; }
.preview-body.mobile-view iframe {
  position: relative; width: 390px; height: 100%; border: none;
  border-radius: 0; box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

/* AI buttons */
.ai-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--teal); font-size: 10px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: inherit; white-space: nowrap;
  vertical-align: middle; margin-bottom: 4px;
}
.ai-btn:hover { background: var(--teal-glow); border-color: var(--teal); color: var(--teal); }
.ai-btn.ai-suggest, .ai-btn.ai-improve { color: var(--teal); }
.ai-btn.ai-suggest:hover, .ai-btn.ai-improve:hover { background: var(--teal-glow); border-color: var(--teal); }
.ai-btn.loading { opacity: 0.6; pointer-events: none; }
.ai-btn.loading::after { content: ' ...'; animation: aiDots 1s steps(3,end) infinite; }
.ai-btn.ai-disabled { opacity: 0.45; cursor: not-allowed; border-color: var(--border); color: var(--text-muted); background: var(--surface); }
.ai-btn.ai-disabled:hover { opacity: 0.45; background: var(--surface); border-color: var(--border); color: var(--text-muted); }
@keyframes aiDots { 0% { content: ' .'; } 33% { content: ' ..'; } 66% { content: ' ...'; } }
.ai-bar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }

/* === Suggest All Banner === */
.ai-suggest-all-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(219,39,119,0.08), rgba(20,184,166,0.06));
  border: 1px solid var(--rose); border-radius: 10px; gap: 12px;
}
.ai-suggest-all-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.ai-suggest-all-icon { color: var(--rose); flex-shrink: 0; }
.ai-suggest-all-info strong { color: var(--text); font-size: 13px; display: block; }
.ai-suggest-all-hint { color: var(--text-muted); font-size: 11px; display: block; margin-top: 2px; }
.ai-suggest-all-btn {
  padding: 8px 18px; border-radius: 8px; border: 1px solid var(--rose);
  background: var(--rose); color: #fff; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.ai-suggest-all-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.ai-suggest-all-btn.loading { opacity: 0.6; pointer-events: none; }

/* === Suggest All Review Modal === */
.ai-sa-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px);
  z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ai-sa-modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  max-width: 620px; width: 100%; max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.ai-sa-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.ai-sa-header h4 { margin: 0; color: var(--rose); font-size: 15px; }
.ai-sa-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.ai-sa-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.sa-review-field { margin-bottom: 14px; }
.sa-review-field label { font-size: 11px; font-weight: 600; color: var(--teal); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; display: block; }
.sa-review-text { font-size: 13px; color: var(--text); line-height: 1.5; padding: 10px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }
.sa-review-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-chip { font-size: 11px; padding: 4px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; color: var(--text); }
.ai-sa-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.ai-sa-cancel { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 12px; cursor: pointer; }
.ai-sa-apply { padding: 8px 18px; border-radius: 8px; border: 1px solid var(--rose); background: var(--rose); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.ai-sa-apply:hover { opacity: 0.9; }
@media (max-width: 600px) {
  .ai-suggest-all-banner { flex-direction: column; text-align: center; }
  .ai-suggest-all-info { flex-direction: column; }
  .ai-suggest-all-btn { width: 100%; }
}

.ai-key-row { display: flex; gap: 8px; align-items: center; }
.ai-key-row input { flex: 1; }
.ai-key-status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ccc; margin-left: 6px; }
.ai-key-status.ok { background: #22c55e; }
.ai-key-status.fail { background: #ef4444; }

/* AI suggestion modal */
.ai-modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 10000; justify-content: center; align-items: center;
  backdrop-filter: blur(3px);
}
.ai-modal-overlay.active { display: flex; }
.ai-modal {
  background: var(--surface, #fff); border-radius: 16px; width: 90vw; max-width: 600px;
  max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.ai-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface-alt, #fafafa);
}
.ai-modal-header h4 { font-size: 14px; color: var(--text); margin: 0; }
.ai-modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--text-muted); padding: 2px 6px; border-radius: 6px; line-height: 1;
}
.ai-modal-close:hover { background: var(--border); color: var(--text); }
.ai-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.ai-modal-original, .ai-modal-suggestion {
  padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; margin-bottom: 12px;
}
.ai-modal-original { background: #f5f5f5; border: 1px solid #e0e0e0; color: #666; }
.ai-modal-suggestion { background: var(--teal-glow); border: 1px solid var(--teal); color: var(--text); }
.ai-modal-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 6px; }
.ai-modal-footer {
  display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px;
  border-top: 1px solid var(--border); background: var(--surface-alt, #fafafa);
}
.ai-modal-btn {
  padding: 10px 22px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; font-family: inherit; transition: all 0.2s;
}
.ai-modal-btn-keep { background: var(--border); color: var(--text-secondary); }
.ai-modal-btn-keep:hover { background: #ddd; }
.ai-modal-btn-use { background: var(--teal); color: #fff; }
.ai-modal-btn-use:hover { filter: brightness(1.1); }

/* AI Improve Chat Modal */
.ai-improve-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 10000; justify-content: center; align-items: center;
  backdrop-filter: blur(3px);
}
.ai-improve-overlay.active { display: flex; }
.ai-improve-modal {
  background: var(--surface, #fff); border-radius: 16px; width: 90vw; max-width: 600px;
  max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.ai-improve-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface-alt, #fafafa);
}
.ai-improve-header h4 { font-size: 14px; color: var(--text); margin: 0; }
.ai-improve-close {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--text-muted); padding: 2px 6px; border-radius: 6px; line-height: 1;
}
.ai-improve-close:hover { background: var(--border); color: var(--text); }
.ai-improve-body { padding: 20px; overflow-y: auto; flex: 1; }
.ai-improve-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin-bottom: 6px;
}
.ai-improve-original {
  padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; margin-bottom: 16px;
  background: #f5f5f5; border: 1px solid #e0e0e0; color: #666;
  max-height: 120px; overflow-y: auto;
}
.ai-improve-input-row { display: flex; gap: 8px; margin-bottom: 16px; }
.ai-improve-input {
  flex: 1; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--surface-alt); resize: none; line-height: 1.4;
  min-height: 42px; max-height: 80px;
}
.ai-improve-input:focus { outline: none; border-color: #b8860b; box-shadow: 0 0 0 3px rgba(184,134,11,0.15); }
.ai-improve-input::placeholder { color: var(--text-muted); }
.ai-improve-send {
  padding: 10px 18px; border-radius: 10px; border: none;
  background: #b8860b; color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
  white-space: nowrap; align-self: flex-end;
}
.ai-improve-send:hover { filter: brightness(1.15); }
.ai-improve-send:disabled { opacity: 0.5; pointer-events: none; }
.ai-improve-result-area { display: none; }
.ai-improve-result-area.visible { display: block; }
.ai-improve-echo {
  padding: 8px 12px; border-radius: 8px; font-size: 12px; line-height: 1.5;
  background: rgba(184,134,11,0.08); border: 1px solid rgba(184,134,11,0.2);
  color: #8a6508; margin-bottom: 10px; font-style: italic;
}
.ai-improve-result {
  padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  background: var(--teal-glow); border: 1px solid var(--teal); color: var(--text);
}
.ai-improve-loading {
  display: none; text-align: center; padding: 20px; color: var(--text-muted); font-size: 13px;
}
.ai-improve-loading.visible { display: block; }
.ai-improve-loading .spinner {
  display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: #b8860b; border-radius: 50%; animation: spin 0.8s linear infinite;
  margin-bottom: 6px;
}
.ai-improve-footer {
  display: none; gap: 10px; justify-content: flex-end; padding: 14px 20px;
  border-top: 1px solid var(--border); background: var(--surface-alt, #fafafa);
}
.ai-improve-footer.visible { display: flex; }
@media (max-width: 768px) {
  .ai-improve-input-row { flex-direction: column; }
  .ai-improve-send { align-self: stretch; }
}

/* Custom alert modal (replaces native alert) */
.alert-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); z-index: 10001; justify-content: center; align-items: center;
  backdrop-filter: blur(2px);
}
.alert-overlay.active { display: flex; }
.alert-box {
  background: var(--surface-alt, #fff); border-radius: 14px; width: 90vw; max-width: 420px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25); overflow: hidden;
  animation: alertSlideIn 0.2s ease-out;
}
@keyframes alertSlideIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: none; } }
.alert-icon {
  display: flex; justify-content: center; padding: 20px 20px 0;
}
.alert-icon-circle {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
}
.alert-icon-circle.info { background: var(--teal-glow); color: var(--teal); }
.alert-icon-circle.warn { background: rgba(234,179,8,0.15); color: #b8860b; }
.alert-icon-circle.error { background: rgba(239,68,68,0.12); color: #dc2626; }
.alert-body {
  padding: 12px 24px 20px; text-align: center;
}
.alert-body p {
  font-size: 14px; line-height: 1.6; color: var(--text); margin: 0;
}
.alert-footer {
  padding: 0 20px 16px; display: flex; justify-content: center;
}
.alert-ok-btn {
  padding: 9px 32px; border-radius: 8px; border: none; font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
  background: var(--rose); color: #fff;
}
.alert-ok-btn:hover { filter: brightness(1.1); }

/* Confirm modal */
.confirm-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); z-index: 10002; justify-content: center; align-items: center;
  backdrop-filter: blur(2px);
}
.confirm-overlay.active { display: flex; }
.confirm-box {
  background: var(--surface-alt, #fff); border-radius: 14px; width: 90vw; max-width: 440px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25); overflow: hidden;
  animation: alertSlideIn 0.2s ease-out;
}
.confirm-icon {
  display: flex; justify-content: center; padding: 20px 20px 0;
}
.confirm-icon-circle {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
  background: rgba(234,179,8,0.15); color: #b8860b;
}
.confirm-title {
  text-align: center; font-weight: 700; font-size: 15px; margin: 12px 24px 0; color: var(--text);
}
.confirm-body {
  padding: 8px 24px 16px; text-align: center;
}
.confirm-body p {
  font-size: 13px; line-height: 1.6; color: var(--text-muted); margin: 0;
}
.confirm-missing {
  font-size: 12px; color: #b8860b; margin-top: 8px; font-style: italic;
}
.confirm-footer {
  padding: 0 20px 16px; display: flex; justify-content: center; gap: 10px;
}
.confirm-btn {
  padding: 9px 22px; border-radius: 8px; border: none; font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.confirm-btn.primary {
  background: var(--rose); color: #fff;
}
.confirm-btn.primary:hover { filter: brightness(1.1); }
.confirm-btn.secondary {
  background: var(--surface, #f3f3f6); color: var(--text); border: 1px solid var(--border, #ddd);
}
.confirm-btn.secondary:hover { background: var(--surface-alt, #e8e8eb); }

/* ===== LANDING PAGE ===== */
.landing {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999;
  background: linear-gradient(160deg, #faf0f3 0%, #e8f4f6 50%, #fef5f8 100%);
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; padding: 20px 20px;
  transition: opacity 0.5s ease, transform 0.5s ease;
  margin: 0;
}
.landing::before, .landing::after {
  content: ''; flex: 1;
}
.landing.hide {
  opacity: 0; transform: translateY(-30px); pointer-events: none;
}
.landing-logo {
  font-size: 30px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(135deg, var(--rose), var(--teal));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: landingFadeUp 0.8s ease both;
}
.landing-subtitle {
  font-size: 13px; color: var(--text-secondary); margin-top: 3px;
  animation: landingFadeUp 0.8s ease 0.15s both;
}
.landing-features {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; max-width: 660px; width: 100%; margin: 16px 0 14px;
}
.landing-card {
  background: rgba(255,255,255,0.75); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 10px; text-align: center;
  animation: landingFadeUp 0.7s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.landing-card:nth-child(1) { animation-delay: 0.15s; }
.landing-card:nth-child(2) { animation-delay: 0.2s; }
.landing-card:nth-child(3) { animation-delay: 0.25s; }
.landing-card:nth-child(4) { animation-delay: 0.3s; }
.landing-card:nth-child(5) { animation-delay: 0.35s; }
.landing-card:nth-child(6) { animation-delay: 0.4s; }
.landing-card:hover {
  transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}
.landing-card-icon {
  font-size: 18px; margin-bottom: 4px; display: flex; justify-content: center; align-items: center;
  color: var(--rose);
}
.landing-card-icon svg { display: block; }
.landing-card h3 {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.landing-card p {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.4;
}
.landing-cta {
  animation: landingFadeUp 0.8s ease 0.55s both;
  text-align: center;
}
.landing-start-btn {
  display: inline-block; padding: 10px 34px;
  background: linear-gradient(135deg, var(--rose), var(--teal));
  color: #fff; font-size: 14px; font-weight: 700;
  border: none; border-radius: 50px; cursor: pointer;
  font-family: inherit; letter-spacing: 0.3px;
  box-shadow: 0 6px 24px rgba(212, 86, 126, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.landing-start-btn:hover {
  transform: translateY(-2px); box-shadow: 0 10px 32px rgba(212, 86, 126, 0.4);
}
.landing-start-btn:active { transform: translateY(0); }
/* ===== LANDING PRICING ===== */
.landing-pricing {
  max-width: 700px; width: 100%; margin-top: 16px;
  animation: landingFadeUp 0.8s ease 0.65s both;
}
.landing-pricing-title {
  font-size: 12px; font-weight: 700; color: var(--text); text-align: center;
  margin-bottom: 10px; letter-spacing: 0.3px; text-transform: uppercase;
}
.landing-pricing-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.landing-price-card {
  background: rgba(255,255,255,0.75); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 12px; text-align: center; position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.landing-price-card:hover {
  transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}
.landing-price-card-highlight {
  border: 2px solid transparent;
  background-image: linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.85)), linear-gradient(135deg, var(--rose), var(--teal));
  background-origin: border-box; background-clip: padding-box, border-box;
  transform: scale(1.03);
}
.landing-price-card-highlight:hover {
  transform: scale(1.03) translateY(-3px);
  box-shadow: 0 10px 28px rgba(15,107,125,0.12);
}
.landing-price-recommended {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--rose), var(--teal));
  color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 2px 12px; border-radius: 10px; letter-spacing: 0.5px; white-space: nowrap;
}
.landing-price-badge {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.landing-price-value {
  font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.1;
}
.landing-price-cents {
  font-size: 14px; font-weight: 700;
}
.landing-price-desc {
  font-size: 10.5px; color: var(--text-muted); line-height: 1.4;
  margin: 5px 0 8px; min-height: 26px;
}
.landing-price-list {
  list-style: none; padding: 0; margin: 0; text-align: left; font-size: 11px; line-height: 1.7;
}
.landing-price-list li { position: relative; padding-left: 18px; }
.landing-price-list li.yes::before {
  content: '\2713'; position: absolute; left: 0; color: #22c55e; font-weight: 700; font-size: 12px;
}
.landing-price-list li.no::before {
  content: '\2717'; position: absolute; left: 0; color: #ccc; font-weight: 700; font-size: 12px;
}
.landing-price-list li.no { color: var(--text-muted); }
.landing-pricing-payment {
  display: flex; flex-direction: column; align-items: center;
  margin-top: 10px; font-size: 10px; color: var(--text-muted);
  animation: landingFadeUp 0.8s ease 0.85s both;
}
@keyframes landingFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 600px) {
  .landing-logo { font-size: 28px; }
  .landing-subtitle { font-size: 13px; }
  .landing-features { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .landing-start-btn { padding: 11px 32px; font-size: 14px; }
  .landing-card p { font-size: 11px; }
  .landing-pricing-cards { grid-template-columns: 1fr; gap: 10px; max-width: 280px; margin: 0 auto; }
  .landing-price-card-highlight { transform: scale(1); }
  .landing-price-card-highlight:hover { transform: translateY(-3px); }
  .landing-pricing { margin-top: 20px; }
}

/* ===== STYLE PICKER MODAL ===== */
.style-picker-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.style-picker-overlay.active { display: flex; }
.style-picker-modal {
  background: var(--surface-alt); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  max-width: 480px; width: 100%; padding: 28px 24px 22px; text-align: center;
  animation: landingFadeUp 0.35s ease both;
}
.style-picker-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 18px;
}
.style-picker-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 14px;
}
.style-picker-card {
  border: 2px solid var(--border); border-radius: 10px;
  padding: 14px 8px 10px; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.style-picker-card:hover {
  transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.style-picker-card.active {
  border-color: transparent;
  background-image: linear-gradient(var(--surface-alt), var(--surface-alt)), linear-gradient(135deg, var(--rose), var(--teal));
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 4px 16px rgba(212,86,126,0.15);
}
.style-picker-swatch {
  display: flex; gap: 3px; justify-content: center; margin-bottom: 6px;
}
.style-picker-swatch span {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  opacity: 0.7;
}
.style-picker-name {
  font-size: 12px; font-weight: 700; color: var(--text);
}
.style-picker-colors {
  font-size: 10px; color: var(--text-muted); margin-top: 2px;
}
.style-picker-note {
  font-size: 11px; color: var(--text-muted); margin-bottom: 16px;
}
.style-picker-footer {
  display: flex; gap: 10px; justify-content: center;
}
.style-picker-skip {
  padding: 8px 20px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text-muted); font-size: 12px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.style-picker-skip:hover { border-color: var(--text-muted); color: var(--text); }
.style-picker-apply {
  padding: 8px 24px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--rose), var(--teal));
  color: #fff; font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
  box-shadow: 0 3px 12px rgba(212,86,126,0.25);
}
.style-picker-apply:hover {
  transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212,86,126,0.35);
}
@media (max-width: 520px) {
  .style-picker-cards { grid-template-columns: repeat(2, 1fr); }
  .style-picker-modal { max-width: 95vw; padding: 22px 16px 18px; }
}

/* ===== PAYMENT MODAL ===== */
.pay-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.pay-overlay.active { display: flex; }
/* Prompt modal */
.pay-prompt-modal {
  background: var(--surface-alt); border-radius: 16px; position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,255,255,0.06);
  max-width: 380px; width: 100%; padding: 36px 28px 28px; text-align: center;
  animation: landingFadeUp 0.3s ease both;
}
.pay-prompt-modal .pay-close-x { position: absolute; top: 10px; right: 10px; }
.pay-prompt-icon {
  font-size: 40px; color: var(--rose); margin-bottom: 8px;
  filter: drop-shadow(0 2px 8px rgba(231,76,101,0.3));
}
.pay-prompt-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.pay-prompt-msg { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin: 0 0 16px; }
.pay-prompt-methods {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 18px; opacity: 0.85;
}
.pay-prompt-link {
  display: block; margin-top: 14px; font-size: 12px; color: var(--text-muted);
  text-decoration: none; font-weight: 600; transition: color 0.2s;
}
.pay-prompt-link:hover { color: var(--rose-deep); }
.pay-modal-wide {
  background: var(--surface-alt); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  max-width: 640px; width: 100%; padding: 0; overflow: hidden;
  animation: landingFadeUp 0.35s ease both;
}
.pay-modal-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 12px;
}
.pay-modal-top h3 { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.pay-close-x {
  background: none; border: none; font-size: 24px; color: var(--text-muted);
  cursor: pointer; padding: 4px 8px; border-radius: 6px; line-height: 1;
}
.pay-close-x:hover { background: var(--surface); color: var(--text); }
.pay-cards {
  display: flex; gap: 14px; padding: 0 24px 16px; align-items: stretch;
}
.pay-card {
  flex: 1; border: 2px solid var(--border); border-radius: 12px;
  padding: 20px 18px; text-align: center; transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.pay-card:hover, .pay-card.highlight {
  border-color: var(--rose); box-shadow: 0 4px 16px rgba(212,86,122,0.15);
}
.pay-card-pro {
  border-color: var(--teal);
}
.pay-card-pro:hover, .pay-card-pro.highlight {
  border-color: var(--teal); box-shadow: 0 4px 16px rgba(15,107,125,0.2);
}
.pay-card-badge {
  display: inline-block; padding: 3px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--rose-glow); color: var(--rose);
}
.pay-card-pro .pay-card-badge {
  background: rgba(15,107,125,0.1); color: var(--teal);
}
.pay-card-price {
  font-size: 32px; font-weight: 800; margin: 10px 0 2px; color: var(--text);
}
.pay-card-period {
  font-size: 12px; color: var(--text-muted); margin-bottom: 14px;
}
.pay-card-features {
  list-style: none; padding: 0; margin: 0; text-align: left; font-size: 12px; line-height: 2;
}
.pay-card-features li { position: relative; padding-left: 20px; }
.pay-card-features li.yes::before {
  content: '\2713'; position: absolute; left: 0; color: #22c55e; font-weight: 700;
}
.pay-card-features li.no::before {
  content: '\2717'; position: absolute; left: 0; color: #ccc; font-weight: 700;
}
.pay-card-features li.no { color: var(--text-muted); }
.pay-body { padding: 0 24px 16px; }
.pay-method {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.pay-method:hover { border-color: var(--rose); background: var(--rose-glow); }
.pay-method-title {
  font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px;
}
.pay-method-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.pay-method-link {
  display: inline-block; margin-top: 6px; padding: 7px 18px;
  background: var(--rose); color: #fff; border-radius: 8px;
  font-size: 12px; font-weight: 600; text-decoration: none;
  transition: background 0.2s;
}
.pay-method-link:hover { background: var(--rose-deep); }
.pay-method-phone {
  display: inline-block; margin-top: 4px; padding: 5px 12px;
  background: var(--surface); border-radius: 6px;
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: 1px; user-select: all;
}
.pay-footer {
  padding: 0 24px 18px; text-align: center;
}
.pay-footer-note {
  font-size: 11px; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px;
}
/* ===== PAYMENT FORM (Step 1) ===== */
.pay-form { padding: 0 24px 16px; }
.pay-form-row { margin-bottom: 12px; }
.pay-form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.pay-form-input {
  width: 100%; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text);
  transition: border-color 0.2s; box-sizing: border-box;
}
.pay-form-input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-glow); }
.pay-form-error { font-size: 12px; color: #dc2626; margin-bottom: 10px; padding: 8px 12px; background: rgba(220,38,38,0.06); border-radius: 6px; }
.pay-submit-btn {
  width: 100%; padding: 11px 18px; background: var(--rose); color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background 0.2s, opacity 0.2s;
}
.pay-submit-btn:hover { background: var(--rose-deep); }
.pay-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pay-card-selectable, .plan-card-selectable { cursor: pointer; }
.pay-card-selectable.selected, .plan-card-selectable.selected { border-color: var(--rose); box-shadow: 0 4px 16px rgba(212,86,122,0.15); }
.pay-card-pro.pay-card-selectable.selected, .plan-card-pro.plan-card-selectable.selected { border-color: var(--teal); box-shadow: 0 4px 16px rgba(15,107,125,0.2); }
/* ===== PAYMENT CONFIRMATION (Step 2) ===== */
.pay-confirmation { padding: 10px 24px 24px; text-align: center; }
.pay-confirm-icon {
  width: 48px; height: 48px; border-radius: 50%; background: #d1fae5; color: #065f46;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; margin-bottom: 12px;
}
.pay-confirm-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.pay-confirm-ref {
  font-size: 15px; color: var(--text); background: var(--surface);
  padding: 8px 16px; border-radius: 8px; display: inline-block; margin-bottom: 6px;
  letter-spacing: 0.5px; user-select: all;
}
.pay-confirm-plan { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.pay-confirm-instructions { text-align: left; }
.pay-confirm-instructions p { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.5; }
.pay-confirm-note { font-size: 11px; color: var(--text-muted); line-height: 1.5; margin-top: 14px; text-align: center; }
/* ===== PAYMENT ICONS ===== */
.pay-icon { display: inline-block; vertical-align: middle; margin-right: 4px; position: relative; top: -1px; }
.pay-icon-sm { display: inline-block; vertical-align: middle; }
.pay-method-title { display: flex; align-items: center; gap: 6px; }
.plan-card-payment-methods {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
}
/* ===== PLANOS TAB ===== */
.plan-current {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 8px; background: var(--surface);
  border: 1px solid var(--border);
}
.plan-current-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-muted);
}
.plan-current-dot.free { background: var(--text-muted); }
.plan-current-dot.basic { background: #f59e0b; }
.plan-current-dot.pro { background: #10b981; }
.plan-current-name { font-size: 15px; font-weight: 700; color: var(--text); }
.plan-current-desc { font-size: 12px; color: var(--text-muted); }
.plan-ai-counter { margin-left: auto; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); white-space: nowrap; }
.plan-ai-counter.warn { color: #d97706; border-color: #fbbf24; background: #fffbeb; }
.plan-ai-counter.critical { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.plan-cards-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.plan-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 18px 16px; text-align: center; background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.plan-card-active { border-color: #7c3aed; box-shadow: 0 0 0 2px rgba(124,58,237,0.15); }
.plan-card .plan-card-badge {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.plan-card .plan-card-price {
  font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 2px;
}
.plan-card .plan-card-period {
  font-size: 11px; color: var(--text-muted); margin-bottom: 12px;
}
@media (max-width: 700px) {
  .plan-cards-grid { grid-template-columns: 1fr; }
}
/* Truncation notice in AI modals */
.ai-trunc-note {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  background: rgba(184,134,11,0.08); border: 1px solid rgba(184,134,11,0.2);
  font-size: 12px; color: #8a6508; line-height: 1.5; text-align: center;
}
.ai-trunc-icon { font-size: 14px; vertical-align: middle; margin-right: 4px; }
@media (max-width: 520px) {
  .pay-cards { flex-direction: column; }
  .pay-modal-wide { max-width: 95vw; }
}

/* ===== STICKY ACTION BAR ===== */
.sticky-action-bar {
  position: sticky; bottom: 0; z-index: 198;
  display: flex; gap: 8px; padding: 10px 12px;
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
.sticky-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border: 1.5px solid transparent; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.sticky-btn svg { flex-shrink: 0; }
.sticky-btn-gerar {
  background: var(--teal); color: #fff; border-color: var(--teal);
}
.sticky-btn-gerar:hover {
  opacity: 0.9; box-shadow: 0 2px 8px rgba(15,107,124,0.3); transform: translateY(-1px);
}
.sticky-btn.active {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3), 0 2px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

/* ===== DOCUMENTS TAB ===== */
.doc-upload-form {
  display: flex; flex-direction: column; gap: 12px;
}
.doc-drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 24px 16px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--bg);
}
.doc-drop-zone:hover, .doc-drop-zone.dragover {
  border-color: var(--rose); background: var(--rose-glow);
}
.doc-drop-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-muted);
}
.doc-drop-placeholder svg { opacity: 0.5; }
.doc-drop-placeholder span { font-size: 12px; }
.doc-drop-hint { font-size: 11px; opacity: 0.6; }
.doc-drop-zone.has-file {
  border-color: var(--teal); background: var(--teal-glow);
  border-style: solid;
}
.doc-drop-zone.has-file .doc-drop-placeholder { color: var(--teal); }
.doc-add-btn {
  align-self: flex-start;
}
.doc-add-btn:disabled {
  opacity: 0.4; cursor: not-allowed;
}

/* Document list */
.doc-list {
  display: flex; flex-direction: column; gap: 8px;
}
.doc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: all 0.2s;
}
.doc-item:hover { border-color: var(--rose); }
.doc-item-icon {
  width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.doc-item-icon.pdf { background: rgba(220,38,38,0.1); color: #dc2626; }
.doc-item-icon.jpg, .doc-item-icon.jpeg { background: rgba(234,179,8,0.1); color: #ca8a04; }
.doc-item-icon.png { background: rgba(59,130,246,0.1); color: #3b82f6; }
.doc-item-info { flex: 1; min-width: 0; }
.doc-item-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-item-meta {
  font-size: 11px; color: var(--text-muted);
  display: flex; gap: 8px; align-items: center;
}
.doc-item-type {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px;
}
.doc-item-delete {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  display: grid; place-items: center; font-size: 14px; transition: all 0.2s;
  flex-shrink: 0;
}
.doc-item-delete:hover { color: #dc2626; border-color: #dc2626; background: rgba(220,38,38,0.06); }
.doc-summary {
  margin-top: 10px; font-size: 11px; color: var(--text-muted); text-align: right;
}
.doc-info-box {
  padding: 14px 16px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--text-muted); line-height: 1.7;
}
.doc-info-box > strong { color: var(--text); font-size: 12px; display: block; margin-bottom: 6px; }
.doc-info-box li strong { color: var(--text); }
.doc-info-box ul { padding-left: 18px; margin: 0; }
.doc-info-box li { margin-bottom: 2px; }

@media (max-width: 768px) {
  .sticky-action-bar { padding: 8px; }
  .sticky-btn { font-size: 12px; padding: 8px 12px; }
  .doc-upload-form .form-row { grid-template-columns: 1fr !important; }
}

/* ===== FOCUS-VISIBLE (accessibility) ===== */
*:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
}
.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--rose-glow);
}
button:focus-visible { outline-offset: 2px; }
input[type="checkbox"]:focus-visible { outline-offset: 3px; }
input[type="color"]:focus-visible { outline-offset: 3px; border-radius: 4px; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ===== PAYMENT ICONS ===== */
.pay-icons {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 6px;
}
.pay-icons img, .pay-icons svg { vertical-align: middle; display: block; }

/* ===== MOBILE EDITOR BLOCK ===== */
.mobile-block {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100000;
  background: linear-gradient(160deg, #faf0f3 0%, #e8f4f6 50%, #fef5f8 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.mobile-block-card {
  background: #fff; border-radius: 20px; padding: 36px 28px;
  max-width: 380px; width: 100%; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.07);
}
.mobile-block-icon { font-size: 48px; margin-bottom: 12px; }
.mobile-block-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: #1f1f28; }
.mobile-block-card p { font-size: 13px; color: #4a4a58; line-height: 1.6; margin-bottom: 20px; }
.mobile-block-actions { display: flex; flex-direction: column; gap: 8px; }
.mobile-block-btn {
  background: linear-gradient(135deg, var(--rose, #d4567e), var(--teal, #0f6b7c));
  color: #fff; border: none; padding: 11px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.mobile-block-btn-secondary {
  background: transparent; color: var(--text-muted, #6b7280);
  border: 1px solid var(--border, rgba(0,0,0,0.08)); padding: 10px 20px;
  border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.mobile-block-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 10px; font-size: 14px; font-family: inherit;
}

/* ===== SKIP LINK (Accessibility) ===== */
.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 9999;
  background: var(--rose); color: #fff; padding: 8px 18px;
  border-radius: 0 0 8px 8px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ===== LANDING H2 (was h3) ===== */
.landing-card h2 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }

/* ===== COOKIE CONSENT BANNER ===== */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 99999;
  background: var(--surface, #fef5f8); color: var(--text, #1f1f28);
  padding: 10px 24px;
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; line-height: 1.4;
  border-top: 1px solid var(--rose, #d4567e);
  box-shadow: 0 -4px 16px rgba(212,86,126,0.06);
}
.cookie-banner p { flex: 1; margin: 0; color: var(--text-secondary, #4a4a58); }
.cookie-banner a { color: var(--rose, #d4567e); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner button {
  background: var(--rose, #d4567e); color: #fff; border: none; padding: 7px 18px;
  border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; font-family: inherit;
  box-shadow: 0 2px 8px rgba(212,86,126,0.25); transition: all 0.2s;
}
.cookie-banner button:hover { background: var(--rose-deep, #b8426a); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(212,86,126,0.35); }
.cookie-btn-secondary {
  background: transparent !important; color: var(--text-muted, #6b7280) !important;
  border: 1px solid var(--border, rgba(0,0,0,0.08)) !important;
  box-shadow: none !important;
}
.cookie-btn-secondary:hover { background: var(--surface-alt, #fff) !important; color: var(--text, #1f1f28) !important; transform: none !important; }
@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; text-align: center; padding: 14px 16px; }
}
