/* Visitor accounts: header button, sign-in / profile page, comments.
   Loaded before components.css. */

/* ---------- Header button ---------- */
.account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0.0625rem solid rgba(192, 192, 196, 0.4);
  border-radius: 50%;
  background: rgba(43, 43, 47, 0.55);
  color: #e2e2e6;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.account-btn:hover { color: #fff; border-color: rgba(224, 40, 63, 0.75); box-shadow: 0 0 0.9rem rgba(139, 30, 45, 0.5); }
.account-btn:focus-visible { outline: 0.1875rem solid #e2e2e6; outline-offset: 0.1875rem; }
.account-btn[aria-current="page"] { border-color: rgba(224, 40, 63, 0.75); }
.account-btn.is-signed-in { border-color: rgba(224, 40, 63, 0.6); }
.account-btn__avatar,
.nv-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #8b1e2d, #3a0d14);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
}
.account-btn__avatar img,
.nv-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-menu { position: relative; display: flex; align-items: center; flex: none; margin-left: auto; }
.account-menu + .nav-toggle { margin-left: 0.5rem; }
/* Signed out: a small "Sign up" pill instead of the icon. */
.account-btn.is-signed-out { width: auto; padding: 0 0.95rem; cursor: pointer; border-radius: 999px; font-size: 0.875rem; font-weight: 600; line-height: 1; letter-spacing: 0.01em; white-space: nowrap; }
@media (min-width: 48rem) {
  .account-menu { order: 10; margin-left: 0; }
  .account-btn { width: 2.25rem; height: 2.25rem; }
  .account-btn svg { width: 16px; height: 16px; }
  .account-btn.is-signed-out { width: auto; padding: 0 0.85rem; font-size: 0.8125rem; }
  .header-cta { order: 9; }
}

/* ---------- Account page ---------- */
.account-wrap { max-width: 34rem; padding-top: 2.5rem; padding-bottom: 3rem; }
.account-card {
  padding: 1.5rem;
  border: 0.0625rem solid rgba(192, 192, 196, 0.22);
  border-radius: 1.1rem;
  background: rgba(23, 23, 27, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}
.account-card + .account-card { margin-top: 1.25rem; }
.account-card h1, .account-card h2 { margin-top: 0; }
.account-card h2 { font-size: 1.15rem; }
.account-note { color: #c0c0c4; font-size: 0.9375rem; }
.account-privacy { margin: 1rem 0 0; padding: 0.75rem 0.9rem; border-left: 0.1875rem solid rgba(224, 40, 63, 0.7); background: rgba(43, 43, 47, 0.45); border-radius: 0 0.6rem 0.6rem 0; color: #c0c0c4; font-size: 0.875rem; }
.account-soon { margin: 0 0 1rem; padding: 0.75rem 1rem; border: 0.0625rem solid rgba(224, 40, 63, 0.45); border-radius: 0.75rem; background: rgba(139, 30, 45, 0.2); color: #f2f2f4; font-size: 0.9375rem; }
.account-page [hidden] { display: none !important; }
.account-profile { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.account-profile .nv-avatar { width: 4.5rem; height: 4.5rem; font-size: 1.75rem; flex: none; border: 0.125rem solid rgba(224, 40, 63, 0.6); }
.account-profile__name { margin: 0; font-size: 1.2rem; font-weight: 700; color: #f2f2f4; overflow-wrap: anywhere; }
.account-profile__email { margin: 0.15rem 0 0; color: #c0c0c4; font-size: 0.875rem; overflow-wrap: anywhere; }
.account-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.account-actions .button { margin: 0; }
.account-file { width: 100%; padding: 0.4rem 0; color: #c0c0c4; font: inherit; font-size: 0.9375rem; }
.account-file::file-selector-button { margin-right: 0.75rem; min-height: 2.5rem; padding: 0 1rem; border: 0.0625rem solid rgba(192, 192, 196, 0.5); border-radius: 999px; background: rgba(43, 43, 47, 0.7); color: #f2f2f4; font: inherit; cursor: pointer; }
.cropper { margin-top: 1rem; }
.cropper__frame { position: relative; width: min(16rem, 100%); aspect-ratio: 1; border-radius: 0.9rem; overflow: hidden; border: 0.0625rem solid rgba(192, 192, 196, 0.35); background: #0b0b0d; touch-action: none; cursor: grab; }
.cropper__frame canvas { display: block; width: 100%; height: 100%; }
.cropper__frame::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(11, 11, 13, 0.55); pointer-events: none; }
.cropper__zoom { display: flex; align-items: center; gap: 0.75rem; width: min(16rem, 100%); margin-top: 0.75rem; color: #c0c0c4; font-size: 0.875rem; }
.cropper__zoom input { flex: 1; accent-color: #e0283f; }

/* ---------- Comments (cards with likes) ---------- */
.like-slot.is-ready { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.comment-btn {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.5rem; padding: 0 0.9rem 0 0.75rem;
  border: 0.0625rem solid rgba(192, 192, 196, 0.35); border-radius: 999px; background: rgba(43, 43, 47, 0.5);
  color: #c0c0c4; font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.comment-btn:hover, .comment-btn[aria-expanded="true"] { color: #f2f2f4; border-color: rgba(192, 192, 196, 0.6); }
.comment-btn:focus-visible { outline: 0.1875rem solid #e2e2e6; outline-offset: 0.1875rem; }
.comments { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 0.0625rem solid rgba(192, 192, 196, 0.18); text-align: left; }
.comments[hidden] { display: none; }
.comments__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; max-height: 22rem; overflow-y: auto; }
.comment { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.6rem; }
.comment .nv-avatar { width: 2rem; height: 2rem; font-size: 0.85rem; }
.comment__meta { margin: 0; font-size: 0.8125rem; color: #a0a0a6; }
.comment__meta strong { color: #f2f2f4; font-weight: 600; margin-right: 0.4rem; }
.comment__body { margin: 0.15rem 0 0; color: #e2e2e6; font-size: 0.9375rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment__del { margin-left: 0.4rem; padding: 0; border: 0; background: none; color: #ff8a98; font: inherit; font-size: 0.8125rem; text-decoration: underline; cursor: pointer; }
.comments__empty, .comments__prompt { margin: 0; color: #c0c0c4; font-size: 0.875rem; }
.comments__prompt a { color: #f2f2f4; }
.comments__form { margin-top: 0.85rem; }
.comments__form textarea {
  width: 100%; min-height: 4.5rem; padding: 0.6rem 0.75rem; border: 0.0625rem solid rgba(192, 192, 196, 0.35); border-radius: 0.6rem;
  background: #151518; color: #f2f2f4; font: inherit; font-size: 0.9375rem; resize: vertical;
}
.comments__form textarea:focus-visible { outline: 0.125rem solid rgba(224, 40, 63, 0.8); outline-offset: 0.0625rem; }
.comments__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.5rem; }
.comments__count { color: #a0a0a6; font-size: 0.8125rem; }
.comments__row .button { margin: 0; min-height: 2.5rem; }
.comments__status { margin: 0.4rem 0 0; font-size: 0.8125rem; color: #ffb3bd; }
@media (prefers-reduced-motion: reduce) { .account-btn, .comment-btn { transition: none; } }

/* Comments sit inside list-based cards (guides): undo the card styling
   that ".service-list li" would otherwise give each comment. */
:root .theme-dark .comments .comments__list > li.comment,
:root .theme-dark .comments .comments__list > li.comment:hover,
:root .theme-dark .comments .comments__list > li.comment:focus-within {
  margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; transform: none; transition: none;
}
/* Forms inside account cards don't need a second glass box. */
:root .theme-dark .account-card .form {
  padding: 0; border: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.account-private { color: #a0a0a6; font-weight: 400; font-size: 0.85em; }

/* Terms and Privacy agreement on the sign-in form */
.account-agree__label { display: flex; align-items: flex-start; gap: 0.6rem; font-weight: 400; font-size: 0.9375rem; line-height: 1.45; color: #d6d6da; cursor: pointer; }
.account-agree__label input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0.12rem 0 0; accent-color: #e0283f; }
.account-agree__label a { color: #f2f2f4; text-decoration: underline; }
#signin-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .account-btn.is-signed-out { padding: 0 0.6rem; font-size: 0.75rem; }
}

/* Signed-out menu: sign in or sign up */
.account-menu.is-open .account-btn { border-color: rgba(224, 40, 63, 0.75); color: #fff; }
.account-pop {
  position: absolute; top: calc(100% + 0.6rem); right: 0; z-index: 60;
  width: min(18rem, calc(100vw - 2rem)); padding: 0.4rem 1rem;
  border: 0.0625rem solid rgba(192, 192, 196, 0.25); border-radius: 1rem;
  background: rgba(20, 20, 23, 0.97); box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  text-align: left; letter-spacing: normal; text-transform: none;
}
.account-pop[hidden] { display: none; }
.account-pop__part { padding: 0.85rem 0; }
.account-pop__part + .account-pop__part { border-top: 0.0625rem solid rgba(192, 192, 196, 0.18); }
.account-pop__q { margin: 0 0 0.6rem; color: #e2e2e6; font-size: 0.9rem; font-weight: 600; line-height: 1.35; }
:root .account-pop .account-pop__btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 2.75rem; padding: 0 1rem;
  border-radius: 999px; font-family: inherit; font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.01em; text-transform: none; text-decoration: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
:root .account-pop .account-pop__btn--primary { border: 0.0625rem solid rgba(224, 40, 63, 0.7); background: linear-gradient(135deg, #b3263a, #7a1424); color: #fff; }
:root .account-pop .account-pop__btn--secondary { border: 0.0625rem solid rgba(192, 192, 196, 0.45); background: rgba(43, 43, 47, 0.55); color: #f2f2f4; }
:root .account-pop .account-pop__btn:hover { box-shadow: 0 0 0.9rem rgba(139, 30, 45, 0.55); border-color: rgba(224, 40, 63, 0.85); }
:root .account-pop .account-pop__btn:focus-visible { outline: 0.1875rem solid #e2e2e6; outline-offset: 0.1875rem; }
:root .account-pop .account-pop__q, :root .account-pop .account-pop__note { font-family: inherit; text-transform: none; letter-spacing: normal; }
.account-pop__note { margin: 0.6rem 0 0; color: #a9a9ae; font-size: 0.8125rem; line-height: 1.45; }

/* ---------- Favorites ---------- */
.fav-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; min-height: 2.5rem;
  border: 0.0625rem solid rgba(192, 192, 196, 0.35); border-radius: 999px; background: rgba(43, 43, 47, 0.55);
  color: #c0c0c4; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease;
}
.fav-btn svg path { fill: transparent; }
.fav-btn:hover, .fav-btn[aria-expanded="true"] { color: #f2f2f4; border-color: rgba(192, 192, 196, 0.6); }
.fav-btn[aria-pressed="true"] { color: #f5c04a; border-color: rgba(245, 192, 74, 0.6); }
.fav-btn[aria-pressed="true"] svg path { fill: #f5c04a; }
.fav-btn:focus-visible { outline: 0.1875rem solid #e2e2e6; outline-offset: 0.1875rem; }
.fav-panel { margin-top: 0.75rem; padding: 0.75rem 0.85rem; border: 0.0625rem solid rgba(192, 192, 196, 0.18); border-radius: 0.75rem; background: rgba(20, 20, 23, 0.6); text-align: left; }
.fav-panel__prompt { margin: 0; color: #d6d6da; font-size: 0.9rem; }
.fav-panel__prompt a { color: #fff; text-decoration: underline; }
.fav-panel__form label { display: block; margin-bottom: 0.35rem; color: #e2e2e6; font-size: 0.875rem; font-weight: 600; text-transform: none; letter-spacing: normal; }
.fav-panel__hint { color: #a9a9ae; font-weight: 400; }
.fav-panel__form textarea { width: 100%; min-height: 3.5rem; padding: 0.5rem 0.65rem; border: 0.0625rem solid rgba(192, 192, 196, 0.35); border-radius: 0.6rem; background: rgba(11, 11, 13, 0.7); color: #f2f2f4; font: inherit; font-size: 0.9rem; resize: vertical; }
.fav-panel__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.fav-panel__status { margin-right: auto; color: #c0c0c4; font-size: 0.8125rem; }
:root .fav-panel .button { min-height: 2.25rem; padding: 0 0.9rem; font-size: 0.8125rem; }
.fav-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0 0 1rem; }
.fav-filter__btn {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.5rem; padding: 0 1rem;
  border: 0.0625rem solid rgba(192, 192, 196, 0.4); border-radius: 999px; background: rgba(43, 43, 47, 0.55);
  color: #e2e2e6; font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
}
.fav-filter__btn svg path { fill: transparent; }
.fav-filter__btn[aria-pressed="true"] { color: #fff; border-color: rgba(245, 192, 74, 0.7); }
.fav-filter__btn[aria-pressed="true"] svg { color: #f5c04a; }
.fav-filter__btn[aria-pressed="true"] svg path { fill: #f5c04a; }
.fav-filter__btn:focus-visible { outline: 0.1875rem solid #e2e2e6; outline-offset: 0.1875rem; }
.fav-filter__note { margin: 0; color: #c0c0c4; font-size: 0.9rem; }
.fav-only .project-card:not(.is-favorite),
.fav-only .guide-card:not(.is-favorite) { display: none !important; }

/* Account page: My favorites and My downloads */
.account-list { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.account-list__item { padding: 0.75rem 0; border-top: 0.0625rem solid rgba(192, 192, 196, 0.16); }
.account-list__item:first-child { border-top: 0; }
.account-list__title { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.account-list__title a { color: #f2f2f4; }
.account-list__meta { color: #a9a9ae; font-weight: 400; font-size: 0.8125rem; }
.account-list__again { font-size: 0.8125rem; font-weight: 400; color: #e2e2e6; }
.account-list__empty { color: #c0c0c4; font-size: 0.9375rem; }
.account-fav-note { margin-top: 0.5rem; }
.account-fav-note label { display: block; margin-bottom: 0.3rem; font-size: 0.8125rem; color: #d6d6da; }
.account-fav-note textarea { width: 100%; padding: 0.5rem 0.65rem; border: 0.0625rem solid rgba(192, 192, 196, 0.35); border-radius: 0.6rem; background: rgba(11, 11, 13, 0.7); color: #f2f2f4; font: inherit; font-size: 0.9rem; resize: vertical; }
.account-fav-note__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.account-fav-note__row > span { margin-right: auto; }
:root .account-fav-note .button { min-height: 2.25rem; padding: 0 0.9rem; font-size: 0.8125rem; }
:root .account-list > li.account-list__item, :root .account-list > li.account-list__empty { list-style: none; background: none; border-left: 0; border-right: 0; border-bottom: 0; box-shadow: none; border-radius: 0; margin: 0; }
@media (prefers-reduced-motion: reduce) { .fav-btn { transition: none; } }

/* Delete account */
.account-delete-link { margin: 2rem 0 0.5rem; text-align: center; font-size: 0.875rem; }
.account-delete-link a { color: #b4b4ba; text-decoration: underline; }
.account-delete-link a:hover, .account-delete-link a:focus-visible { color: #ff7a8a; }
.account-help { margin: 0.4rem 0 0; color: #a9a9ae; font-size: 0.8125rem; }
.account-help span { display: inline-block; margin-left: 0.35rem; color: #c0c0c4; }
.account-agree__hint { color: #a9a9ae; font-weight: 400; }
#del-form textarea { width: 100%; padding: 0.6rem 0.75rem; border: 0.0625rem solid rgba(192, 192, 196, 0.35); border-radius: 0.6rem; background: rgba(11, 11, 13, 0.7); color: #f2f2f4; font: inherit; resize: vertical; }
#del-form .account-agree__label { margin: 1rem 0 0.25rem; }
:root .account-danger-btn { background: rgba(176, 24, 45, 0.85); border-color: #e0283f; color: #fff; }
:root .account-danger-btn:disabled { opacity: 0.5; cursor: not-allowed; }
