/* UI partilhada: cadastro, perfis — alinhada ao tema público (streaming) */
.app-streaming-page {
  margin: 0;
  min-height: 100vh;
  background: var(--app-bg, #0a0a0d);
  color: var(--app-text, #f5f5f5);
  font-family: var(--app-font, "Plus Jakarta Sans", system-ui, sans-serif);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 5vw;
  background: linear-gradient(180deg, rgba(8, 8, 12, 0.95) 0%, rgba(8, 8, 12, 0.6) 100%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.app-topbar__brand img {
  height: 34px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.app-topbar__title {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50vw;
}

.app-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-tab {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.65);
  transition: background 0.2s, color 0.2s;
}

.app-tab:hover {
  color: #fff;
}

.app-tab--active {
  background: var(--app-primary, #e50914);
  color: #fff;
}

.app-page-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.app-streaming-page::before {
  content: "";
  position: fixed;
  inset: -24%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 72% 52% at 12% 10%, color-mix(in srgb, var(--app-primary, #e50914) 36%, transparent) 0%, transparent 56%),
    radial-gradient(ellipse 60% 48% at 90% 14%, rgba(80, 172, 255, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 56% 40% at 45% 92%, rgba(135, 98, 255, 0.15) 0%, transparent 52%);
}
.app-streaming-page > * {
  position: relative;
  z-index: 1;
}

.app-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.14) 0%, rgba(16, 18, 36, 0.72) 45%, rgba(8, 8, 14, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 22px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-card--narrow {
  max-width: 520px;
  margin: 0 auto 16px;
  padding-bottom: 16px;
}

.app-hero-h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.app-sub {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.58);
}

.app-card label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.88rem;
  font-weight: 600;
}

.app-input,
.app-card input[type="text"],
.app-card input[type="email"],
.app-card input[type="date"],
.app-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1rem;
  box-sizing: border-box;
}

.app-input:focus,
.app-card input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--app-primary, #e50914) 55%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary, #e50914) 25%, transparent);
}

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 14px 20px;
  border: 0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
}

.app-btn--primary {
  background: var(--app-primary, #e50914);
  color: #fff;
}

.app-btn--primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.app-err {
  background: rgba(100, 20, 20, 0.45);
  border: 1px solid rgba(200, 60, 60, 0.5);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 0.9rem;
}

.app-flash-ok {
  background: rgba(20, 80, 40, 0.45);
  border: 1px solid rgba(50, 160, 80, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 0.9rem;
  text-align: center;
}

.app-back-link {
  text-align: center;
  margin-top: 24px;
}

.app-muted-link {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.9rem;
}

.app-muted-link:hover {
  color: #fff;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.chk {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
}
.chk input {
  margin-top: 3px;
  width: auto;
}
.captcha-bloco {
  margin-top: 16px;
}
.g-recaptcha {
  margin-top: 8px;
}

/* —— Perfis (Netflix-style) —— */
.profiles-shell {
  min-height: 100vh;
  background: var(--app-bg, #0a0a0d);
  color: var(--app-text, #f5f5f5);
  font-family: var(--app-font, "Plus Jakarta Sans", system-ui, sans-serif);
  position: relative;
  overflow-x: hidden;
}

/* Fundo personalizado (imagem do painel “Página perfil”) */
.profiles-shell--has-bg,
.app-streaming-page.profiles-shell--has-bg {
  background-color: var(--app-bg, #0a0a0d);
}
.profiles-shell--has-bg::before,
.app-streaming-page.profiles-shell--has-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(195deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 38%, rgba(0, 0, 0, 0.88) 100%), var(--profile-page-bg);
  background-size: auto, cover;
  background-position: 0% 0%, var(--profile-page-bg-pos, 50% 50%);
  background-repeat: no-repeat, no-repeat;
  background-attachment: scroll, fixed;
}
.app-streaming-page.profiles-shell--has-bg .app-topbar,
.profiles-shell--has-bg .app-topbar {
  position: relative;
  z-index: 4;
}
.app-streaming-page.profiles-shell--has-bg .app-page-wrap {
  position: relative;
  z-index: 2;
}

.profiles-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  position: relative;
  z-index: 2;
}
.profiles-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.profiles-h1 {
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 8px 0 8px;
}
.profiles-h1--glow {
  background: linear-gradient(120deg, #fff 0%, rgba(255, 255, 255, 0.88) 40%, color-mix(in srgb, var(--app-primary, #e50914) 75%, #fff) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px color-mix(in srgb, var(--app-primary, #e50914) 30%, transparent);
  filter: drop-shadow(0 2px 24px rgba(0, 0, 0, 0.5));
}
.profiles-hint {
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 28px;
}
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 8px;
}
.profile-tile {
  position: relative;
  background: linear-gradient(165deg, rgba(35, 35, 45, 0.5) 0%, rgba(10, 10, 16, 0.95) 100%);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 14px 12px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, box-shadow 0.35s;
  outline: none;
  /* Reset de <button> (evita texto preto do user-agent) */
  color: var(--app-text, #f5f5f5);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}
button.profile-tile,
.profile-tile[role="button"] {
  color: var(--app-text, #f5f5f5);
}
.profile-tile--glass {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.1) 0%, rgba(12, 12, 22, 0.65) 45%, rgba(4, 4, 12, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.profile-tile--glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--app-primary, #e50914) 0%, transparent) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.profile-tile--glass:hover::after,
.profile-tile--glass:focus-within::after,
.profile-tile--glass.is-selected::after {
  opacity: 0.22;
}
.profile-tile:hover,
.profile-tile:focus-visible,
.profile-tile.is-selected {
  transform: translateY(-8px) scale(1.03);
  border-color: color-mix(in srgb, var(--app-primary, #e50914) 55%, rgba(255, 255, 255, 0.2));
  box-shadow: 0 24px 56px color-mix(in srgb, var(--app-primary, #e50914) 12%, rgba(0, 0, 0, 0.45)), 0 0 0 1px color-mix(in srgb, var(--app-primary, #e50914) 30%, transparent);
}
.profile-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.profile-tile input:checked ~ img {
  box-shadow: 0 0 0 2px #f0f0f0, 0 0 0 4px #141414, 0 0 0 5px var(--app-primary, #e50914), 0 12px 36px rgba(0, 0, 0, 0.55);
  border-radius: 5px;
}
.profile-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 5px;
  background: #18181a;
  display: block;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.profile-tile--glass img {
  border-color: rgba(255, 255, 255, 0.16);
}
.profile-tile--glass .nm {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.profile-tile .nm {
  margin-top: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #f3f3f3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}
.profile-tile .kid-lbl {
  font-size: 0.7rem;
  color: #93c5fd;
  margin-top: 4px;
}
/* Modo «Gerir perfis»: cartão é <div> (não <button> do UA) */
#manageGrid .profile-tile--manage {
  color: #f5f5f5;
  -webkit-tap-highlight-color: transparent;
}
#manageGrid .profile-tile--manage .nm,
#manageGrid .profile-tile--manage .kid-lbl,
#manageGrid .profile-tile--manage,
#manageGrid .profile-tile--manage * {
  color: #f2f2f2 !important;
  -webkit-text-fill-color: #f2f2f2;
}
#manageGrid .profile-tile--manage .nm {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}
.profile-tile--manage .profile-tile__editbtn {
  display: block;
  margin-top: 10px;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  background: color-mix(in srgb, var(--app-primary, #e50914) 55%, rgba(0, 0, 0, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  user-select: none;
}
.pf-selected-bar {
  margin: 12px 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--app-primary, #e50914) 18%, rgba(0, 0, 0, 0.35));
  border: 2px solid color-mix(in srgb, var(--app-primary, #e50914) 50%, rgba(255, 255, 255, 0.2));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0.96;
}
.pf-selected-bar--visible {
  display: block;
}
.pf-selected-bar__row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pf-selected-bar__thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0f;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.pf-selected-bar__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pf-selected-bar__text {
  min-width: 0;
  text-align: left;
}
.pf-selected-bar__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.pf-selected-bar__sub {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.62);
  margin-top: 4px;
  line-height: 1.35;
}
.profiles-launch-ico {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--app-primary, #e50914) 25%, rgba(0, 0, 0, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.profile-tile--glass:hover .profiles-launch-ico,
.profile-tile--glass:focus-within .profiles-launch-ico {
  opacity: 1;
  transform: scale(1);
}
.profiles-shell .app-topbar {
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, rgba(6, 6, 12, 0.92) 0%, rgba(6, 6, 12, 0.55) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}
.profiles-shell--has-bg .app-topbar {
  z-index: 4;
  background: linear-gradient(180deg, rgba(3, 3, 6, 0.94) 0%, rgba(3, 3, 8, 0.72) 100%);
}
.profiles-actions {
  text-align: center;
  margin-top: 8px;
}
.profiles-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  background: var(--app-primary, #e50914);
  color: #fff;
  transition: filter 0.2s, transform 0.15s;
}
.profiles-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.profiles-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}
.profiles-msg {
  max-width: 640px;
  margin: 0 auto 16px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  text-align: center;
}
.profiles-msg--ok {
  background: rgba(20, 80, 40, 0.35);
  border: 1px solid rgba(50, 160, 80, 0.35);
}
.profiles-msg--err {
  background: rgba(100, 20, 20, 0.4);
  border: 1px solid rgba(200, 60, 60, 0.4);
}

/* Modal perfil */
.pf-modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pf-modal-bg.is-open {
  display: flex;
}
.pf-modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #1a1a22, #0f0f14);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px 18px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  color: #ececec;
}
.pf-modal h3 {
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}
.pf-modal label[for] {
  color: rgba(255, 255, 255, 0.9);
}
.pf-modal .app-input {
  color: #fff;
}
.pf-avatars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 14px;
}
.pf-av {
  position: relative;
  cursor: pointer;
  border-radius: 4px;
  border: 2px solid #333441;
  overflow: hidden;
  background: #18181b;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}
.pf-av:hover {
  transform: scale(1.08);
  border-color: #e5e5e5;
  z-index: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.pf-av input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pf-av img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}
.pf-av input:checked + img {
  box-shadow: inset 0 0 0 1px #000, 0 0 0 2px #f5f5f5, 0 0 0 1px #000;
  border-radius: 2px;
}
.pf-av:has(input:checked) {
  border-color: #f5f5f5;
  box-shadow: 0 0 0 1px #000, 0 4px 16px rgba(0, 0, 0, 0.55);
  transform: scale(1.05);
  z-index: 2;
}
/* Navegadores antigos / fallback quando :has não repõe o estado: classe por JS */
.pf-av.pf-av--selected {
  border-color: #f5f5f5;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-primary, #e50914) 65%, #fff), 0 4px 16px rgba(0, 0, 0, 0.55);
  transform: scale(1.05);
  z-index: 2;
}
.pf-av.pf-av--selected img {
  box-shadow: inset 0 0 0 1px #000, 0 0 0 2px #f5f5f5, 0 0 0 1px #000, 0 0 0 4px
    color-mix(in srgb, var(--app-primary, #e50914) 65%, transparent);
  border-radius: 2px;
}
.pf-avatars-note {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 8px 0 0;
}
.pf-avatars-note strong {
  color: rgba(255, 255, 255, 0.95);
}
.pf-kid {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0 16px;
  font-size: 0.9rem;
}
.pf-kid small {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  margin-top: 4px;
}
.pf-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pf-modal-actions .profiles-btn {
  flex: 1;
  min-width: 120px;
}

@media (max-width: 500px) {
  .pf-avatars {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
}
