@keyframes profile-signal-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body[data-profile-page] .content {
  max-width: 980px;
  padding-bottom: 90px;
}

body[data-theme="light"][data-profile-page="true"] .profile-hero-card,
body[data-theme="light"][data-profile-page="true"] .profile-details-card,
body[data-theme="light"][data-profile-page="true"] .profile-membership-card,
body[data-theme="light"][data-profile-page="true"] .profile-security,
body[data-theme="light"][data-profile-page="true"] .profile-note,
body[data-theme="light"][data-profile-page="true"] .field input {
  background: linear-gradient(145deg, var(--nlc-panel), var(--nlc-panel-raised));
  border-color: var(--nlc-line);
  color: var(--nlc-text);
}

body[data-theme="dark"][data-profile-page="true"] .profile-hero-card,
body[data-theme="dark"][data-profile-page="true"] .profile-details-card,
body[data-theme="dark"][data-profile-page="true"] .profile-membership-card,
body[data-theme="dark"][data-profile-page="true"] .profile-security,
body[data-theme="dark"][data-profile-page="true"] .profile-note,
body[data-theme="dark"][data-profile-page="true"] .field input {
  background: linear-gradient(145deg, #0d1d2b, #0f2436);
  border-color: #23445d;
  color: var(--nlc-text);
}

body[data-theme="light"][data-profile-page="true"] .profile-cover {
  background: linear-gradient(110deg, rgba(214, 240, 248, 0.9), rgba(233, 244, 249, 0.96) 52%, rgba(236, 244, 249, 0.95));
}

body[data-theme="dark"][data-profile-page="true"] .profile-cover {
  background: linear-gradient(110deg, rgba(18, 43, 59, 0.96), rgba(17, 33, 46, 0.96) 52%, rgba(18, 35, 49, 0.98));
}

body[data-theme="light"][data-profile-page="true"] .profile-note,
body[data-theme="light"][data-profile-page="true"] .profile-copy p,
body[data-theme="light"][data-profile-page="true"] .profile-security p,
body[data-theme="light"][data-profile-page="true"] .field label,
body[data-theme="light"][data-profile-page="true"] .details-lock {
  color: var(--nlc-muted);
}

body[data-theme="dark"][data-profile-page="true"] .profile-note,
body[data-theme="dark"][data-profile-page="true"] .profile-copy p,
body[data-theme="dark"][data-profile-page="true"] .profile-security p,
body[data-theme="dark"][data-profile-page="true"] .field label,
body[data-theme="dark"][data-profile-page="true"] .details-lock {
  color: var(--nlc-muted) !important;
}

body[data-theme="light"][data-profile-page="true"] .field input {
  background: rgba(255, 255, 255, 0.9);
}

body[data-theme="dark"][data-profile-page="true"] .field input {
  background: rgba(12, 24, 37, 0.82);
  border-color: #23445d;
}

body[data-theme="light"][data-profile-page="true"] .profile-intro {
  padding-bottom: 18px;
}

body[data-profile-page] .profile-hero-card,
body[data-profile-page] .profile-details-card,
body[data-profile-page] .profile-security {
  position: relative;
  border: 1px solid var(--nlc-line);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(35, 74, 89, 0.08);
  overflow: hidden;
  animation: profile-signal-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body[data-profile-page] .profile-hero-card::before,
body[data-profile-page] .profile-details-card::before,
body[data-profile-page] .profile-security::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(61, 141, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(61, 141, 255, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(135deg, rgba(0, 0, 0, 1), transparent 72%);
}

body[data-theme="dark"] body[data-profile-page] .profile-hero-card,
body[data-theme="dark"] body[data-profile-page] .profile-details-card,
body[data-theme="dark"] body[data-profile-page] .profile-security,
body[data-theme="dark"] body[data-profile-page] .profile-membership-card,
body[data-theme="dark"] body[data-profile-page] .profile-note {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

body[data-profile-page] .profile-cover {
  height: 88px;
  border-bottom: 1px solid var(--nlc-line);
  background: linear-gradient(110deg, rgba(214, 240, 248, 0.9), rgba(233, 244, 249, 0.96) 52%, rgba(236, 244, 249, 0.95));
}

body[data-theme="dark"] body[data-profile-page] .profile-cover {
  background: linear-gradient(110deg, rgba(18, 43, 59, 0.96), rgba(17, 33, 46, 0.96) 52%, rgba(18, 35, 49, 0.98));
}

body[data-profile-page] .profile-cover::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  background-image: linear-gradient(rgba(61, 141, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(61, 141, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

body[data-profile-page] .profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px 15px;
  position: relative;
  z-index: 1;
}

body[data-profile-page] .profile-avatar-wrap {
  position: relative;
  margin-top: -34px;
}

body[data-profile-page] .profile-avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(34, 215, 255, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(34, 215, 255, 0.08), 0 0 23px rgba(34, 215, 255, 0.18);
  pointer-events: none;
}

body[data-profile-page] .profile-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 3px solid #f4fbff;
  border-radius: 50%;
  background: linear-gradient(145deg, #cfeaf7, #a8d7ef 42%, #dfeef5);
  background-position: center;
  background-size: cover;
  color: #103a4c;
  font: 700 20px 'DM Mono', monospace;
  box-shadow: 0 0 0 1px rgba(34, 215, 255, 0.3), 0 12px 26px rgba(31, 98, 124, 0.12);
  transition: transform 0.22s ease, filter 0.22s ease;
}

body[data-profile-page] .profile-avatar-wrap:hover .profile-avatar {
  transform: scale(1.03);
  filter: brightness(1.02);
}

body[data-profile-page] .profile-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(20, 45, 58, 0.08);
  pointer-events: none;
}

body[data-profile-page] .profile-copy {
  flex: 1;
  min-width: 0;
  padding-top: 14px;
}

body[data-profile-page] .profile-copy h3 {
  margin-top: 5px;
  color: var(--nlc-text);
  font-size: 19px;
  letter-spacing: -0.4px;
}

body[data-profile-page] .profile-copy p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--nlc-muted);
  font-size: 10px;
}

body[data-profile-page] .profile-identity-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  align-self: flex-start;
}

body[data-profile-page] .dot-separator {
  color: #3c718d;
}

body[data-profile-page] .photo-button {
  position: absolute;
  right: -4px;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid #10263b;
  border-radius: 50%;
  background: linear-gradient(135deg, #4fe0ff, #20b9ff);
  color: #041821;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(32, 185, 255, 0.28);
  transition: transform 0.2s ease, filter 0.2s ease;
}

body[data-profile-page] .photo-button:hover {
  transform: scale(1.08);
  filter: brightness(1.08);
}

body[data-profile-page] .change-photo-button {
  margin-top: 0;
  padding: 9px 12px;
  border: 1px solid rgba(87, 143, 186, 0.65);
  border-radius: 8px;
  background: rgba(10, 25, 37, 0.9);
  color: #d7ebf7;
  font-size: 10px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

body[data-profile-page] .change-photo-button:hover {
  transform: translateY(-1px);
  border-color: rgba(51, 209, 255, 0.9);
  background: rgba(16, 45, 63, 0.96);
}

body[data-profile-page] .change-photo-button span {
  margin-left: 7px;
  color: var(--cyan);
}

body[data-profile-page] .profile-note {
  position: relative;
  z-index: 1;
  padding: 12px 22px;
  border-top: 1px solid var(--nlc-line);
  color: var(--nlc-muted);
  font-size: 9px;
  background: rgba(255, 255, 255, 0.28);
}

body[data-theme="dark"] body[data-profile-page] .profile-note {
  background: rgba(8, 20, 27, 0.35);
}

body[data-profile-page] .profile-note.error,
body[data-profile-page] .profile-save-message.error {
  color: var(--nlc-danger);
}

body[data-profile-page] .profile-details-card {
  margin-top: 18px;
  padding: 22px;
}

body[data-profile-page] .profile-membership-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid var(--nlc-line);
  border-radius: 14px;
  background: linear-gradient(110deg, var(--nlc-panel-raised), var(--nlc-panel));
}

body[data-profile-page] .profile-membership-card h3 { margin-top: 6px; color: var(--nlc-text); font-size: 18px; }
body[data-profile-page] .profile-membership-card strong { color: var(--nlc-green); font: 700 15px 'DM Mono', monospace; text-align: right; }
body[data-profile-page] .membership-status { margin-top: 6px; color: var(--nlc-green); font-size: 10px; }
body[data-profile-page] .membership-status.locked { color: var(--nlc-danger); }

@media (max-width: 620px) {
  body[data-profile-page] .profile-membership-card { align-items: flex-start; flex-direction: column; }
  body[data-profile-page] .profile-membership-card strong { text-align: left; }
}

body[data-profile-page] .details-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

body[data-profile-page] .details-heading h3 {
  margin-top: 6px;
  color: var(--nlc-text);
  font-size: 18px;
  letter-spacing: -0.3px;
}

body[data-profile-page] .details-lock {
  padding: 6px 8px;
  border: 1px solid rgba(34, 213, 154, 0.25);
  border-radius: 6px;
  background: rgba(34, 213, 154, 0.08);
  color: var(--nlc-green);
  font: 700 8px 'DM Mono', monospace;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

body[data-profile-page] .profile-form {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  position: relative;
  z-index: 1;
}

body[data-profile-page] .field {
  display: grid;
  gap: 7px;
}

body[data-profile-page] .field label {
  color: var(--nlc-muted);
  font: 700 9px 'DM Mono', monospace;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

body[data-profile-page] .field input {
  width: 100%;
  padding: 12px 11px;
  border: 1px solid var(--nlc-line);
  border-radius: 8px;
  background: var(--nlc-panel-raised);
  color: var(--nlc-text);
  font: 13px Manrope, sans-serif;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body[data-profile-page] .field input:focus {
  border-color: rgba(61, 141, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(61, 141, 255, 0.12);
}

body[data-profile-page] .field input[readonly] {
  background: rgba(239, 246, 250, 0.9);
  color: var(--nlc-text);
}

body[data-theme="dark"] body[data-profile-page] .field input,
body[data-theme="dark"] body[data-profile-page] .field input[readonly] {
  background: rgba(12, 23, 33, 0.92);
}

body[data-profile-page] .button.profile-save {
  align-self: end;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(71, 180, 255, 0.45);
  border-radius: 8px;
  background: linear-gradient(135deg, #0d6ec6, #19bfd7);
  color: #ecfbff;
  font: 700 11px Manrope, sans-serif;
  box-shadow: 0 10px 20px rgba(18, 166, 219, 0.25);
  transition: transform 0.18s ease, filter 0.18s ease;
}

body[data-profile-page] .button.profile-save:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

body[data-profile-page] .button.profile-save span {
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.82);
}

body[data-profile-page] .profile-save-message {
  grid-column: 1 / -1;
  min-height: 14px;
  color: #9ae7d5;
  font-size: 10px;
  margin-top: -4px;
}

body[data-profile-page] .profile-security {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  margin-top: 18px;
  background: linear-gradient(135deg, rgba(221, 244, 255, 0.9), rgba(255, 255, 255, 0.96));
}

body[data-theme="dark"] body[data-profile-page] .profile-security {
  background: linear-gradient(135deg, rgba(12, 31, 41, 0.94), rgba(9, 19, 27, 0.96));
}

body[data-profile-page] .security-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(34, 213, 154, 0.12), rgba(61, 141, 255, 0.08));
  color: var(--nlc-green);
  font-size: 18px;
  border: 1px solid rgba(34, 213, 154, 0.22);
}

body[data-profile-page] .profile-security strong {
  display: block;
  color: var(--nlc-text);
  font-size: 13px;
}

body[data-profile-page] .profile-security p {
  margin-top: 4px;
  color: var(--nlc-muted);
  font-size: 10px;
}

@media (max-width: 700px) {
  body[data-profile-page] .profile-identity {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  body[data-profile-page] .profile-identity-actions {
    width: 100%;
    align-items: stretch;
  }

  body[data-profile-page] .change-photo-button {
    width: 100%;
    text-align: center;
  }

  body[data-profile-page] .profile-form {
    grid-template-columns: 1fr;
  }
}
