/* FreeTools Hub - Citation Generator (APA 7, MLA 9, Chicago author-date) */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f8fafc; color: #1e293b; line-height: 1.6; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

.site-header { background: linear-gradient(135deg, #1d4ed8, #7c3aed); color: #fff; padding: 40px 0 32px; }
.crumb { color: #dbeafe; text-decoration: none; font-size: .9rem; }
.crumb:hover { text-decoration: underline; }
.site-header h1 { font-size: 2rem; margin: 8px 0 4px; }
.site-header .sub { opacity: .92; }
.estimate-badge { display: inline-block; margin-top: 14px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.4); padding: 8px 16px; border-radius: 10px; font-weight: 700; font-size: .9rem; }

main.wrap { padding-top: 28px; padding-bottom: 40px; }
.card { background: #fff; border-radius: 14px; padding: 24px; margin-bottom: 20px; box-shadow: 0 2px 16px rgba(15,23,42,.06); }
.card h2 { font-size: 1.2rem; margin-bottom: 14px; }
.small-note { font-size: .85rem; color: #64748b; font-weight: 400; }
.hidden { display: none !important; }

/* Segmented + type pickers */
.seg { display: inline-flex; border: 2px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.seg-btn { border: none; background: #fff; padding: 12px 22px; font-weight: 700; cursor: pointer; color: #64748b; }
.seg-btn.active { background: #1d4ed8; color: #fff; }
.type-row { display: flex; gap: 8px; flex-wrap: wrap; }
.type-btn { border: 2px solid #e2e8f0; background: #fff; border-radius: 12px; padding: 10px 16px; font-weight: 700; cursor: pointer; color: #475569; font-size: .92rem; }
.type-btn.active { border-color: #1d4ed8; color: #1d4ed8; background: #eff6ff; }

/* Autofill */
.autofill-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.autofill-row input { flex: 1; min-width: 220px; border: 2px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; font-size: .95rem; }
.autofill-row input:focus { border-color: #1d4ed8; outline: none; }
#autofillMsg { margin-top: 6px; min-height: 1.2em; }

/* Form */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; border: 2px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; font-size: .95rem; font-family: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #1d4ed8; outline: none; }
.frow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field.hidden-field { display: none; }

/* Buttons */
.btn { border: none; border-radius: 10px; padding: 12px 22px; font-weight: 700; font-size: .95rem; cursor: pointer; }
.btn.primary { background: #1d4ed8; color: #fff; width: 100%; margin-top: 6px; }
.btn.primary:hover { background: #1e40af; }
.btn.secondary { background: #7c3aed; color: #fff; white-space: nowrap; }
.btn.secondary:hover { background: #6d28d9; }
.btn.ghost { background: #f1f5f9; color: #334155; }
.btn.ghost:hover { background: #e2e8f0; }

/* Preview + bibliography */
.citation { background: #f8fafc; border-left: 4px solid #1d4ed8; padding: 14px 16px; border-radius: 0 10px 10px 0; font-size: .96rem; }
.bib-item { display: flex; gap: 10px; align-items: flex-start; background: #f8fafc; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.bib-item .cite-text { flex: 1; font-size: .93rem; }
.bib-item .cite-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mini-btn { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 6px 10px; font-size: .8rem; font-weight: 700; cursor: pointer; color: #475569; }
.mini-btn:hover { border-color: #1d4ed8; color: #1d4ed8; }
.export-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.export-row .btn.primary { width: auto; margin-top: 0; flex: 1; min-width: 220px; }
#bibCount { color: #1d4ed8; }

/* FAQ */
.faq { border-bottom: 1px solid #f1f5f9; padding: 12px 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin-top: 8px; color: #475569; font-size: .94rem; }

.site-footer { text-align: center; padding: 24px 0 36px; color: #94a3b8; font-size: .85rem; }

@media (max-width: 640px) {
  .site-header h1 { font-size: 1.5rem; }
  .frow { grid-template-columns: 1fr; }
  .seg { width: 100%; } .seg-btn { flex: 1; padding: 12px 8px; }
}
