/* --------------------------------------------------------------------------
   Account, auth pages and video comments.

   Reuses the tokens from styles.css (colours, radii, --sans) so the new
   surfaces match the catalog instead of looking bolted on.
   -------------------------------------------------------------------------- */

/* The [hidden] attribute loses against our own display rules, so scope an
   !important reset to just the elements this stylesheet shows and hides. */
.nav-account[hidden],
.comments[hidden],
.comments__form[hidden],
.comments__prompt[hidden],
.comments__more[hidden],
.auth-panel[hidden],
#signUpForm[hidden],
#recoverForm[hidden],
#resetForm[hidden],
#resetInvalid[hidden],
#resetSuccess[hidden],
#accountPanel[hidden],
#signedOutPanel[hidden],
[data-role="error"][hidden],
[data-role="success"][hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Header account button
   -------------------------------------------------------------------------- */

.nav-account {
  max-width: 190px;
  text-decoration: none;
}

.nav-account__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4566, #ff7349);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.nav-account__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-account__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .nav-account {
    max-width: 46px;
    padding-inline: 10px;
  }

  .nav-account__label {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Auth pages (auth.html / reset-password.html / account.html)
   -------------------------------------------------------------------------- */

body.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 5vw, 48px);
}

.auth-topbar .brand {
  text-decoration: none;
}

.auth-back {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-back:hover {
  color: var(--text);
}

.auth-shell {
  display: grid;
  flex: 1;
  place-items: start center;
  padding: 8px clamp(16px, 5vw, 48px);
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

.auth-card {
  width: 100%;
  max-width: 470px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.auth-tab {
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-tab[aria-selected="true"] {
  background: rgba(255, 59, 92, 0.14);
  color: var(--text);
}

.auth-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.auth-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.85rem;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.field__input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.field__input::placeholder {
  color: #6b6774;
}

.field__input:focus {
  border-color: rgba(255, 59, 92, 0.55);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.field__input[readonly] {
  color: var(--muted);
  cursor: not-allowed;
}

.field__hint {
  color: #6b6774;
  font-size: 0.7rem;
}

.auth-error,
.auth-success {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
}

.auth-error[data-tone="error"],
[data-role="error"][data-tone="error"] {
  color: #ff8fa3;
}

.auth-success,
[data-role="success"][data-tone="success"] {
  color: #7ee0a8;
}

.auth-link {
  justify-self: start;
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-soft);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-form .btn {
  width: 100%;
}

.auth-resend {
  width: 100%;
  margin-top: 12px;
}

.auth-note {
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #6b6774;
  font-size: 0.68rem;
  line-height: 1.5;
}

.auth-panel .auth-card-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 400;
}

.auth-panel + .auth-panel {
  margin-top: 0;
}

.auth-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Account page */

.account-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 22px;
}

.account-header h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 400;
}

.account-member {
  color: var(--muted);
  font-size: 0.75rem;
}

.account-section-title {
  margin: 22px 0 14px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.account-signed-out {
  display: grid;
  gap: 10px;
}

.account-signed-out h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 400;
}

.account-signed-out p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Comments inside the video modal
   -------------------------------------------------------------------------- */

.comments {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.comments__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}

.comments__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.comments__count {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.comments__form {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.comments__input {
  width: 100%;
  min-height: 84px;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
}

.comments__input:focus {
  border-color: rgba(255, 59, 92, 0.55);
  outline: none;
}

.comments__form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comments__hint {
  flex: 1 1 auto;
  color: #ff8fa3;
  font-size: 0.72rem;
  font-weight: 600;
}

.comments__meter {
  color: #6b6774;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.comments__meter.is-near {
  color: var(--gold);
}

.comments__prompt {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.comments__prompt-link {
  color: var(--accent-soft);
  font-weight: 800;
  text-decoration: none;
}

.comments__prompt-link:hover {
  text-decoration: underline;
}

.comments__list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comments__empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.comment {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
}

.comment__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.comment__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment__body {
  min-width: 0;
}

.comment__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.comment__author {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.comment__badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 59, 92, 0.16);
  color: #ffb7c5;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.comment__time {
  color: #6b6774;
  font-size: 0.68rem;
}

.comment__text {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.86rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment__delete {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: #8a8593;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.comment__delete:hover {
  color: #ff8fa3;
}

.comments__status {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.comments__more {
  margin-top: 16px;
}

@media (max-width: 640px) {
  .auth-card {
    padding: 22px;
  }

  .auth-title {
    font-size: 1.65rem;
  }
}

/* --------------------------------------------------------------------------
   Header slot wrapper (index.html)
   -------------------------------------------------------------------------- */

.account-slot {
  display: inline-flex;
}

.account-slot[hidden] {
  display: none !important;
}


/* --------------------------------------------------------------------------
   Aviso de configuração (páginas noindex, visível só para o dono)
   -------------------------------------------------------------------------- */

.auth-setup {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 211, 155, 0.35);
  border-radius: 12px;
  background: rgba(255, 211, 155, 0.08);
}

.auth-setup strong {
  color: var(--gold);
  font-size: 0.82rem;
}

.auth-setup p {
  margin: 0;
  color: #d8b98e;
  font-size: 0.76rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Abas e atividade da conta
   -------------------------------------------------------------------------- */

.account-tabs {
  display: flex;
  gap: 4px;
  margin: 22px 0 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.account-tabs .auth-tab {
  flex: 1;
}

.account-panel {
  animation: account-fade 0.18s ease;
}

@keyframes account-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.activity {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity__item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.activity__item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.activity__thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.activity__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity__title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity__title:hover {
  color: var(--accent-soft);
}

.activity__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: #6b6774;
  font-size: 0.7rem;
}

.activity__meta-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.activity__stars {
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.activity__text {
  margin: 6px 0 0;
  color: var(--muted-strong);
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.activity__delete {
  padding: 0;
  border: 0;
  background: none;
  color: #8a8593;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.activity__delete:hover {
  color: #ff8fa3;
}

.activity-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 560px) {
  .activity__item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .account-tabs .auth-tab {
    font-size: 0.74rem;
    padding-inline: 6px;
  }
}


/* --------------------------------------------------------------------------
   Ajustes de mobile
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  /* Abaixo de 16px o iOS dá zoom ao focar o campo, o que "quebra" a tela. */
  .field__input,
  .comments__input,
  .search__input {
    font-size: 16px;
  }

  /* Alvos de toque confortáveis. */
  .auth-link {
    padding: 10px 0;
  }

  .comment__delete,
  .activity__delete {
    padding: 8px 0;
  }

  .auth-card {
    padding: 20px 18px;
  }

  .auth-title {
    font-size: 1.6rem;
  }

  .account-tabs {
    margin-top: 18px;
  }
}

/* --------------------------------------------------------------------------
   Vídeos recomendados (dentro do modal)
   -------------------------------------------------------------------------- */

.related {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.related__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.related__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.related__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related__item {
  min-width: 0;
}

/* O anúncio ocupa a linha inteira, como um bloco do feed. */
.related__item--ad {
  grid-column: 1 / -1;
}

.related__item--ad .promo-block {
  padding: 6px 0;
}

.related__link {
  display: grid;
  gap: 8px;
  text-decoration: none;
}

.related__thumb {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.related__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.related__link:hover .related__thumb img {
  filter: brightness(1.08);
  transform: scale(1.04);
}

.related__duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.related__name {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.related__link:hover .related__name {
  color: var(--accent-soft);
}

.related__views {
  color: var(--muted);
  font-size: 0.68rem;
}

.related__item--skeleton .related__thumb,
.related__item--skeleton .related__name {
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  background-size: 200% 100%;
  animation: related-shimmer 1.2s linear infinite;
}

.related__item--skeleton .related__name {
  height: 12px;
}

@keyframes related-shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@media (min-width: 560px) {
  .related__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .related__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .related {
    margin-top: 20px;
    padding-top: 18px;
  }

  .related__title {
    font-size: 1.15rem;
  }
}
