:root {
  --profile-bg: #0d1526;
  --profile-card-bg: #ffffff;
  --profile-muted: #6b7280;
  --profile-border: rgba(15, 21, 38, 0.08);
  --profile-primary: #288dc7;
  --profile-primary-dark: #1f6c9f;
  --profile-danger: #d64545;
  --profile-danger-dark: #b13636;
  --profile-success: #1c9c75;
}

body {
  background-color: var(--profile-bg);
}

header nav {
  padding: 1.5rem 2rem;
  grid-template-rows: auto 0px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(6.5rem, 10vw, 8.75rem) 1.5rem 4rem;

  color: #0f172a;
}

.profile-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem 2rem;
  background: linear-gradient(135deg, rgba(17, 27, 48, 0.95), rgba(40, 141, 199, 0.85));
  border-radius: 1.25rem;
  color: #e2e8f0;
  box-shadow: 0 20px 40px rgba(9, 12, 24, 0.35);
}

.profile-hero__content {
  max-width: 520px;
}

.profile-hero__content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.profile-hero__content p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
  color: rgba(226, 232, 240, 0.85);
}

.profile-identity {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1.75rem;
}

.profile-identity__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border: none;
  background: rgba(12, 23, 41, 0.55);
  border-radius: 999px;
  padding: 0.45rem 0.6rem 0.45rem 0.45rem;
  cursor: pointer;
  color: inherit;
  box-shadow: 0 14px 28px rgba(9, 12, 24, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.profile-identity__toggle:hover,
.profile-identity__toggle:focus-visible {
  transform: translateY(-1px);
  background: rgba(12, 23, 41, 0.72);
  box-shadow: 0 18px 34px rgba(9, 12, 24, 0.42);
  outline: none;
}

.profile-identity__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.profile-identity__toggle[aria-expanded="true"] .profile-identity__chevron {
  transform: rotate(180deg);
}

.profile-identity__thumbnails {
  display: inline-flex;
  gap: 0.5rem;
}

.profile-identity__thumbnails .avatar-figure {
  opacity: 0.85;
  transform: scale(0.92);
}

.profile-identity__menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 0;
  min-width: 220px;
  padding: 0.85rem;
  border-radius: 1rem;
  background: rgba(11, 20, 34, 0.95);
  box-shadow: 0 24px 48px rgba(9, 12, 24, 0.45);
  border: 1px solid rgba(148, 197, 255, 0.18);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 10;
  max-height: 340px;
  overflow-y: auto;
}

.profile-identity__menu[hidden] {
  display: none !important;
}

.profile-identity__options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.profile-identity__option {
  border: none;
  background: transparent;
  border-radius: 0.85rem;
  padding: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.profile-identity__option:hover,
.profile-identity__option:focus-visible {
  transform: translateY(-1px);
  background: rgba(40, 141, 199, 0.18);
  box-shadow: 0 18px 30px rgba(40, 141, 199, 0.25);
  outline: none;
}

.profile-identity__option--selected,
.profile-identity__option[aria-pressed="true"] {
  background: rgba(40, 141, 199, 0.28);
  box-shadow: 0 20px 32px rgba(40, 141, 199, 0.35);
}

.profile-identity__option:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.avatar-figure--lg {
  width: 58px;
  height: 58px;
  box-shadow: 0 18px 35px rgba(15, 21, 38, 0.24), inset 0 0 0 3px rgba(255, 255, 255, 0.65), inset 0 0 0 4px rgba(148, 197, 255, 0.25);
}

.avatar-figure--sm {
  width: 32px;
  height: 32px;
  box-shadow: 0 12px 20px rgba(15, 21, 38, 0.18), inset 0 0 0 2px rgba(255, 255, 255, 0.6), inset 0 0 0 3px rgba(148, 197, 255, 0.2);
}

.membership-status {
  min-width: 260px;
  flex: 1 1 260px;
}

.membership-status__panel {
  background: rgba(14, 18, 32, 0.78);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.membership-status__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(40, 141, 199, 0.25);
  color: #e0f2ff;
}

.membership-status__headline {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: #f8fafc;
}

.membership-status__meta,
.membership-status__note {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.82);
}

.membership-status__countdown {
  font-weight: 600;
  color: #ffe082;
}

.membership-status--premium .membership-status__panel {
  background: linear-gradient(135deg, rgba(12, 89, 76, 0.85), rgba(28, 156, 117, 0.7));
  border-color: rgba(28, 156, 117, 0.35);
}

.membership-status--premium .membership-status__badge {
  background: rgba(28, 156, 117, 0.3);
  color: #e6fff6;
}

.membership-status--trial .membership-status__panel {
  background: linear-gradient(135deg, rgba(33, 61, 117, 0.9), rgba(40, 141, 199, 0.7));
  border-color: rgba(40, 141, 199, 0.35);
}

.membership-status--free .membership-status__panel {
  background: rgba(14, 18, 32, 0.78);
  border-color: rgba(255, 255, 255, 0.05);
}

.profile-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.4fr);
  gap: 2.25rem;
  align-items: start;
}

.profile-avatar-status {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.85);
}

.profile-avatar-status--success {
  color: #34d399;
}

.profile-avatar-status--error {
  color: #fca5a5;
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.profile-card {
  background: var(--profile-card-bg);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: 0 18px 35px rgba(15, 21, 38, 0.12);
  border: 1px solid var(--profile-border);
}

.subscription-card {
  position: relative;
  overflow: hidden;
}

.subscription-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(40, 141, 199, 0.18), rgba(28, 156, 117, 0.12));
  opacity: 0.65;
  pointer-events: none;
}

.subscription-card > * {
  position: relative;
}

.profile-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.profile-card__header h2,
.profile-card__header h3 {
  margin: 0;
  color: #0f172a;
  font-weight: 700;
}

.profile-card__subtitle {
  margin: 0;
  color: var(--profile-muted);
  font-size: 0.95rem;
}

.subscription-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin: 0;
}

.subscription-grid .detail {
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  background: rgba(248, 250, 252, 0.7);
  box-shadow: inset 0 0 0 1px rgba(15, 21, 38, 0.05);
}

.subscription-grid dt {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--profile-muted);
  margin-bottom: 0.4rem;
}

.subscription-grid dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.subscription-note {
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.85rem;
  background: rgba(40, 141, 199, 0.08);
  border: 1px solid rgba(40, 141, 199, 0.22);
  color: #0f4c6e;
  font-size: 0.95rem;
  line-height: 1.6;
}

.subscription-note strong {
  color: var(--profile-primary);
}

.profile-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.profile-card__actions--stacked {
  flex-direction: column;
  align-items: stretch;
}

.profile-card__hint {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--profile-muted);
}

.profile-card__hint a {
  color: var(--profile-primary);
  text-decoration: none;
}

.profile-card__hint a:hover {
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 3px solid rgba(40, 141, 199, 0.35);
  outline-offset: 2px;
}

.btn[hidden] {
  display: none !important;
}

.btn-primary {
  background: var(--profile-primary);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(40, 141, 199, 0.25);
}

.btn-primary:hover {
  background: var(--profile-primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(15, 21, 38, 0.05);
  color: #0f172a;
  border: 1px solid rgba(15, 21, 38, 0.12);
}

.btn-secondary:hover {
  background: rgba(15, 21, 38, 0.1);
}

.btn-danger {
  background: var(--profile-danger);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(214, 69, 69, 0.25);
}

.btn-danger:hover {
  background: var(--profile-danger-dark);
  transform: translateY(-1px);
}

.btn-text {
  background: transparent;
  color: var(--profile-primary);
  padding-left: 0;
  padding-right: 0;
}

.btn-text:hover {
  color: var(--profile-primary-dark);
}

@media (max-width: 960px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .profile-hero {
    padding: 1.75rem 1.5rem;
  }

  .profile-identity {
    width: 100%;
  }

  .profile-identity__options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-identity__menu {
    min-width: 0;
    width: min(100%, 260px);
  }

  .profile-card {
    padding: 1.5rem;
  }

  .profile-card__actions {
    flex-direction: column;
    align-items: stretch;
  }
}
