/* ============================================================
   HaveTheIdea SPA — Paper Aesthetic Stylesheet
   Self-contained, no Tailwind dependency in v0.5.1.
   ============================================================ */

:root {
  --paper:        #f5efe2;
  --paper-deep:   #ebe1cc;
  --paper-soft:   #faf6ec;
  --vellum:       #fffcf3;
  --ink:          #1f1a14;
  --ink-2:        #4a4034;
  --ink-3:        #7d705f;
  --ink-faint:    #b3a797;
  --accent:       #c93f1b;
  --accent-deep:  #9c2d10;
  --moss:         #5a6a3f;
  --rule:         rgba(31, 26, 20, 0.10);
  --rule-bold:    rgba(31, 26, 20, 0.22);
  --serif:        Georgia, 'Times New Roman', serif;
  --display:      Georgia, 'Times New Roman', serif;
  --mono:         'Courier New', ui-monospace, monospace;
}

#havetheidea-app, #havetheidea-app * {
  box-sizing: border-box;
}

#havetheidea-app {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.55;
  min-height: 60vh;
  padding: 3rem 1.5rem;
  -webkit-font-smoothing: antialiased;
}

.htidea-wrap {
  max-width: 720px;
  margin: 0 auto;
}

/* ── Headings ──────────────────────────────────────────────── */
.htidea-h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.htidea-h1 em {
  color: var(--accent);
  font-style: italic;
}
.htidea-h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}
.htidea-deck {
  color: var(--ink-2);
  font-size: 1.05rem;
  margin: 0 0 2rem;
  line-height: 1.55;
}

/* ── Card ─────────────────────────────────────────────────── */
.htidea-card {
  background: var(--vellum);
  border: 1px solid var(--rule-bold);
  border-radius: 2px;
  padding: 2rem;
  box-shadow: 0 1px 1px rgba(31,26,20,0.04), 0 12px 32px rgba(31,26,20,0.06);
}
.htidea-card + .htidea-card { margin-top: 1.5rem; }

/* ── Form fields ──────────────────────────────────────────── */
.htidea-field {
  position: relative;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 1.5rem;
}
.htidea-field-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}
.htidea-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
  padding: 0.3rem 0;
}
.htidea-input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}
.htidea-textarea {
  min-height: 4rem;
  resize: vertical;
  line-height: 1.5;
}

/* Honeypot field — visually hidden, accessible to screen readers
   but auto-filling bots will populate it and we can detect them. */
.htidea-honeypot {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Buttons ──────────────────────────────────────────────── */
.htidea-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.6rem;
  background: var(--accent);
  color: var(--vellum);
  border: none;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.htidea-btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}
.htidea-btn:disabled {
  background: var(--ink-faint);
  cursor: not-allowed;
  transform: none;
}
.htidea-btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.htidea-btn-secondary:hover {
  background: var(--ink);
  color: var(--vellum);
}

/* ── Messages ─────────────────────────────────────────────── */
.htidea-msg {
  padding: 1rem 1.2rem;
  border-radius: 2px;
  margin: 1rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
}
.htidea-msg-success {
  background: rgba(90,106,63,0.08);
  border-left: 3px solid var(--moss);
  color: var(--ink);
}
.htidea-msg-error {
  background: rgba(201,63,27,0.08);
  border-left: 3px solid var(--accent);
  color: var(--ink);
}
.htidea-msg-info {
  background: var(--paper-deep);
  border-left: 3px solid var(--ink-3);
  color: var(--ink-2);
}

/* ── Loading state ───────────────────────────────────────── */
.htidea-loader {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--vellum);
  border-top-color: transparent;
  border-radius: 50%;
  animation: htidea-spin 0.7s linear infinite;
}
@keyframes htidea-spin { to { transform: rotate(360deg); } }

/* ── Layout helpers ──────────────────────────────────────── */
.htidea-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.htidea-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.htidea-spacer { height: 1.5rem; }
.htidea-divider {
  border: none;
  border-top: 1px dashed var(--rule-bold);
  margin: 2rem 0;
}

/* ── Account/dossiers list ──────────────────────────────── */
.htidea-list { list-style: none; padding: 0; margin: 0; }
.htidea-list-item {
  padding: 1rem 0;
  border-bottom: 1px dotted var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.htidea-list-item:last-child { border-bottom: none; }
.htidea-list-empty {
  color: var(--ink-3);
  font-style: italic;
  padding: 2rem 0;
  text-align: center;
}

/* ── Sub-type cards ──────────────────────────────────────── */
.htidea-categories {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-top: 1.5rem;
}
.htidea-category-btn {
  text-align: left;
  background: var(--vellum);
  border: 1px solid var(--rule-bold);
  border-radius: 2px;
  padding: 1.2rem 1.4rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.htidea-category-btn:hover {
  background: var(--paper-soft);
  border-color: var(--ink);
  transform: translateX(2px);
}
.htidea-category-btn.is-open {
  background: var(--paper-soft);
  border-color: var(--ink);
}
.htidea-category-name {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 400;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.htidea-category-name em {
  color: var(--accent);
  font-style: italic;
}
.htidea-category-icon { font-size: 1.4rem; }
.htidea-subtypes {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
.htidea-subtype-btn {
  text-align: left;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font: inherit;
  color: var(--ink-2);
  transition: all 0.15s;
}
.htidea-subtype-btn:hover {
  background: var(--ink);
  color: var(--vellum);
  border-color: var(--ink);
}
.htidea-subtype-btn.is-selected {
  background: var(--accent);
  color: var(--vellum);
  border-color: var(--accent);
}

/* ── Country picker ──────────────────────────────────────── */
.htidea-select {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  cursor: pointer;
}
.htidea-select:focus { outline: 2px solid var(--accent); }

/* ── Responsive ──────────────────────────────────────────── */
@media (min-width: 768px) {
  .htidea-categories {
    grid-template-columns: repeat(2, 1fr);
  }
  .htidea-subtypes {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Disclaimer footer ───────────────────────────────────── */
.htidea-disclaimer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--rule);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-3);
  text-align: center;
}
.htidea-disclaimer a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}

/* ════════════════════════════════════════════════════════════════
   v1.0.0 Wizard styles (Stage 3 Wizard UI)
   ════════════════════════════════════════════════════════════════ */

/* Resume banner on /account */
.htidea-resume-banner {
  margin: 1.5rem 0;
}

/* Char counter under textarea */
.htidea-char-counter {
  font-size: 0.85rem;
  color: var(--htidea-muted, #7d705f);
  font-family: 'Courier New', monospace;
}
.htidea-char-counter.is-warning {
  color: #c93f1b;
  font-weight: bold;
}

/* Save indicator next to char counter */
.htidea-wizard-save-indicator {
  font-size: 0.85rem;
  color: var(--htidea-muted, #7d705f);
  font-style: italic;
  transition: opacity 0.3s ease;
}
.htidea-wizard-save-indicator.is-saving {
  color: var(--htidea-accent, #c93f1b);
}
.htidea-wizard-save-indicator.is-saved {
  color: #5a8a3a;
}

/* Progress dots (step indicators) */
.htidea-wizard-progress {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem 0;
  justify-content: center;
}
.htidea-progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(31, 26, 20, 0.15);
  display: inline-block;
  transition: background 0.3s ease, transform 0.3s ease;
}
.htidea-progress-dot.is-done {
  background: #5a8a3a;
}
.htidea-progress-dot.is-current {
  background: var(--htidea-accent, #c93f1b);
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(201, 63, 27, 0.2);
}

/* Review screen step cards */
.htidea-review-card {
  border-top: 1px dashed rgba(31, 26, 20, 0.18);
  padding: 1rem 0;
}
.htidea-review-card:first-of-type {
  border-top: none;
  padding-top: 0;
}

/* Textarea bigger for wizard steps */
.htidea-card .htidea-textarea {
  min-height: 140px;
  font-size: 16px;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════
   v1.0.1 Polish — Stage 4 UX improvements
   ════════════════════════════════════════════════════════════════ */

/* Field error (in-page validation message) */
.htidea-field-error {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(201, 63, 27, 0.08);
  border-left: 3px solid #c93f1b;
  color: #8a2a10;
  font-size: 0.9rem;
  border-radius: 2px;
  animation: htidea-shake 0.3s ease;
}

@keyframes htidea-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* Link-style button (Delete this draft, etc.) */
.htidea-btn-link {
  background: none !important;
  border: none !important;
  color: var(--htidea-muted, #7d705f);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.5rem !important;
}
.htidea-btn-link:hover {
  color: var(--htidea-accent, #c93f1b);
}

/* Resume banner — better visual hierarchy */
.htidea-resume-banner .htidea-card {
  background: rgba(201, 63, 27, 0.03);
  border: 1px dashed rgba(201, 63, 27, 0.2);
}

/* Smooth save indicator transition */
.htidea-wizard-save-indicator.is-saved {
  animation: htidea-fade-in 0.3s ease;
}
@keyframes htidea-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tooltip on progress dots */
.htidea-progress-dot {
  cursor: help;
  position: relative;
}
.htidea-progress-dot.is-done::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
}

/* Better empty state for textarea (placeholder visibility) */
.htidea-card .htidea-textarea::placeholder {
  color: rgba(31, 26, 20, 0.35);
  font-style: italic;
}

/* Wizard shortcut hint at bottom of step */
.htidea-card + .htidea-meta strong {
  color: var(--htidea-text, #1f1a14);
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  background: rgba(31, 26, 20, 0.06);
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
}

/* ════════════════════════════════════════════════════════════════
   v1.0.8 — Custom Sub-type Modal (Fáze 1 final)
   ════════════════════════════════════════════════════════════════ */

.htidea-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(31, 26, 20, 0.55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: htidea-fade-in 0.2s ease;
}

.htidea-modal {
  background: #fffcf3;
  border: 2px solid #1f1a14;
  border-radius: 4px;
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: htidea-slide-up 0.25s ease;
}

@keyframes htidea-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Custom card on /select-type — already styled inline, but ensure label has spacing */
.htidea-custom-card .htidea-h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* ── v1.4.2: dossier preview — match the PDF's editorial style ─────────── */
.htidea-md-content { font-family: var(--serif); color: #1f1d18; line-height: 1.65; }
.htidea-md-content h3 { font-family: var(--display); color: #b35a3a; font-size: 1.3rem; margin: 1.9rem 0 0.6rem; }
.htidea-md-content h4 { font-family: var(--serif); font-weight: 700; color: #b35a3a; font-size: 1.05rem; margin: 1.4rem 0 0.5rem; }
.htidea-md-content p { margin: 0 0 0.95rem; }
.htidea-md-content ul, .htidea-md-content ol { margin: 0 0 0.95rem 1.4rem; padding: 0; }
.htidea-md-content li { margin: 0.3rem 0; }
.htidea-md-content a { color: #b35a3a; }
.htidea-md-content code { background: #f3eee2; padding: 0.05rem 0.32rem; border-radius: 3px; font-family: 'Courier New', monospace; font-size: 0.9em; }
.htidea-md-content blockquote { background: #faf6ee; border: 1px solid #e2dccf; border-left: 3px solid #b35a3a; border-radius: 4px; padding: 0.8rem 1.05rem; margin: 1.2rem 0; color: #4a4636; }
/* tables — mirror the PDF's table.data look */
.htidea-md-content table.htidea-data { width: 100%; border-collapse: collapse; margin: 1.3rem 0; font-size: 0.95rem; }
.htidea-md-content table.htidea-data th { background: #b35a3a; color: #fff; font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; text-align: left; padding: 0.6rem 0.7rem; }
.htidea-md-content table.htidea-data td { padding: 0.55rem 0.7rem; border-bottom: 1px solid #e2dccf; vertical-align: top; }
.htidea-md-content table.htidea-data tbody tr:nth-child(even) td { background: #faf8f3; }
