/* blog-comments.css — v3 */
.blog-comments {
  max-width: 800px;
  margin: 24px auto 40px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.comments-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: #1a1a1a;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: .5rem;
}

/* ── Chooser ──────────────────────────────────────────────────── */
.cm-chooser {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .6rem;
  padding: 1.25rem 1.5rem 1.5rem;
  margin-bottom: 1.5rem;
}
.cm-chooser-prompt {
  font-size: .9rem;
  color: #4a5568;
  margin: 0 0 1rem;
}
.cm-chooser-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

/* ── Auth buttons ─────────────────────────────────────────────── */
.cm-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.1rem;
  border: 1px solid #cbd5e0;
  border-radius: .375rem;
  background: #fff;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, border-color .15s;
  color: #374151;
  white-space: nowrap;
}
.cm-auth-btn:hover  { background: #f1f5f9; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.cm-auth-btn:active { background: #e2e8f0; }

.cm-auth-google   { border-color: #4285F4; }
.cm-auth-facebook { border-color: #1877F2; color: #1877F2; }
.cm-auth-email    { border-color: #10b981; color: #065f46; }

/* ── Email verification forms ─────────────────────────────────── */
.cm-email-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .6rem;
  padding: 1.1rem 1.4rem 1.3rem;
  margin-bottom: 1.5rem;
}

.cm-field-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .35rem;
}

.cm-text-input {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid #cbd5e0;
  border-radius: .375rem;
  font-family: inherit;
  font-size: .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
  box-sizing: border-box;
}
.cm-text-input:focus   { border-color: #4CAF50; box-shadow: 0 0 0 2px rgba(76,175,80,.12); }
.cm-input-error        { border-color: #ef4444 !important; }

.cm-code-input {
  letter-spacing: .3em;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  max-width: 180px;
}

.cm-email-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.cm-email-row .cm-text-input { flex: 1; }

.cm-hint {
  font-size: .78rem;
  color: #6b7280;
  margin: .45rem 0 .75rem;
}

.cm-step-info {
  font-size: .88rem;
  color: #374151;
  margin: 0 0 .85rem;
}

.cm-back-link {
  background: none;
  border: none;
  color: #4CAF50;
  font-size: .82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  margin-top: .5rem;
  display: inline-block;
}
.cm-back-link:hover { color: #388e3c; }
.cm-inline-link { margin: 0 0 0 .5rem; }

.cm-error-msg {
  color: #ef4444;
  font-size: .82rem;
  margin-top: .4rem;
}

/* ── Shared action row ────────────────────────────────────────── */
.cm-guest-actions {
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  margin-top: .6rem;
}

.cm-btn-secondary {
  padding: .4rem .9rem;
  border: 1px solid #cbd5e0;
  border-radius: .375rem;
  background: #fff;
  font-size: .85rem;
  cursor: pointer;
  color: #4a5568;
  transition: background .15s;
}
.cm-btn-secondary:hover { background: #f1f5f9; }

.cm-btn-primary {
  padding: .4rem 1rem;
  border: 1px solid #4CAF50;
  border-radius: .375rem;
  background: #4CAF50;
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.cm-btn-primary:hover    { background: #43a047; }
.cm-btn-primary:disabled { background: #9ca3af; border-color: #9ca3af; cursor: not-allowed; }

/* ── Author bar ───────────────────────────────────────────────── */
.cm-form-wrapper   { margin-bottom: 1.5rem; }

.cm-author-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .65rem;
  font-size: .875rem;
  color: #374151;
}
.cm-author-name   { font-weight: 600; }
.cm-change-link {
  background: none;
  border: none;
  color: #2563eb;
  font-size: .8rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  margin-left: auto;
}
.cm-change-link:hover { color: #1d4ed8; }

/* ── Provider badges ──────────────────────────────────────────── */
.cm-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 1px 7px;
  border-radius: 9999px;
  vertical-align: middle;
}
.cm-badge-member   { background: #dcfce7; color: #166534; }
.cm-badge-google   { background: #dbeafe; color: #1e40af; }
.cm-badge-facebook { background: #dbeafe; color: #1e40af; }
.cm-badge-email    { background: #d1fae5; color: #065f46; }

/* ── Comment form ─────────────────────────────────────────────── */
.comment-form { margin-bottom: .5rem; }

.comment-textarea {
  width: 100%;
  min-height: 90px;
  padding: .65rem .75rem;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  margin-bottom: .5rem;
  font-family: inherit;
  font-size: .9rem;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
}
.comment-textarea:focus { border-color: #4CAF50; box-shadow: 0 0 0 2px rgba(76,175,80,.12); }

.cm-submit-row {
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
}

.comment-submit {
  background: #4CAF50;
  color: #fff;
  padding: .45rem 1.1rem;
  border: none;
  border-radius: .375rem;
  cursor: pointer;
  font-weight: 500;
  font-size: .875rem;
  transition: background .2s;
}
.comment-submit:hover    { background: #43a047; }
.comment-submit:disabled { background: #9ca3af; cursor: not-allowed; }

/* ── Comment list ─────────────────────────────────────────────── */
.comment-list { padding: 0; list-style: none; }

.comment-item {
  margin-bottom: .85rem;
  padding: .9rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.comment-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .4rem;
}
.comment-author { font-weight: 600; color: #1a1a1a; font-size: .9rem; }
.comment-date   { color: #9ca3af; font-size: .78rem; margin-left: auto; }

.comment-content {
  color: #374151;
  line-height: 1.55;
  font-size: .9rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: .4rem;
}

.comment-actions { display: flex; gap: .5rem; }

.comment-reply-btn {
  background: none;
  border: none;
  color: #4CAF50;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.comment-reply-btn:hover { text-decoration: underline; }

.comment-replies  { margin-left: 2rem; margin-top: .75rem; }
.nested-1         { margin-left: 2rem; }
.nested-2         { margin-left: 4rem; }

/* ── Highlight pulse when redirected to auth ──────────────────── */
@keyframes cm-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(76,175,80,0); }
}
.cm-highlight .cm-chooser { animation: cm-pulse .6s ease 2; border-color: #4CAF50; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 720px) {
  .blog-comments     { margin-left: 10px; margin-right: 10px; }
  .nested-1          { margin-left: 1rem; }
  .nested-2          { margin-left: 2rem; }
  .comment-replies   { margin-left: 1rem; }
  .cm-chooser-btns   { flex-direction: column; }
  .cm-auth-btn       { justify-content: center; }
  .cm-email-row      { flex-direction: column; align-items: stretch; }
  .cm-guest-actions,
  .cm-submit-row     { flex-wrap: wrap; }
}
