:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #1d2235;
  --muted: #6f7891;
  --line: #e7ecf3;
  --accent-start: #ffb258;
  --accent-mid: #f05f85;
  --accent-end: #9d5cf7;
  --accent: linear-gradient(90deg, var(--accent-start), var(--accent-mid), var(--accent-end));
  --accent-soft: #f9edf8;
  --success: #22c55e;
  --warning: #f97316;
  --shadow: 0 24px 60px rgba(36, 44, 76, 0.12);
  --shadow-soft: 0 16px 30px rgba(36, 44, 76, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.45;
}

body::before {
  top: -120px;
  right: -120px;
  background: radial-gradient(circle, rgba(255, 178, 88, 0.6), rgba(255, 178, 88, 0));
}

body::after {
  bottom: -140px;
  left: -140px;
  background: radial-gradient(circle, rgba(157, 92, 247, 0.4), rgba(157, 92, 247, 0));
}

h1, h2, h3 {
  font-family: "Sora", "Segoe UI", Tahoma, sans-serif;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

p {
  margin: 0 0 12px;
  color: var(--muted);
}

form {
  margin: 0;
}

button {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.app-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Sora", "Segoe UI", Tahoma, sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
}

.brand-logo {
  display: block;
  height: 38px;
  width: auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: var(--accent);
  box-shadow: var(--shadow-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.header-toggle:focus-visible {
  outline: 3px solid rgba(157, 92, 247, 0.35);
  outline-offset: 2px;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
}

.nav-link.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(157, 92, 247, 0.3);
}

.nav-link:hover {
  color: var(--ink);
}

.nav-logout {
  margin: 0;
}

.app-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-size: 2rem;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border-radius: 28px;
  border: 1px solid rgba(231, 236, 243, 0.9);
  box-shadow: var(--shadow-soft);
}

.card--padded {
  padding: 24px;
}

.card--center {
  text-align: center;
  padding: 32px 24px;
}

.card-title {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.card-subtitle {
  color: var(--muted);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--accent-soft);
  color: var(--accent-mid);
}

.badge--success {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.badge--warning {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}

.badge--neutral {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
}

.gradient-text {
  background: var(--accent);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.alert {
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 600;
}

.alert--success {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.alert--error {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.field-label {
  font-size: 0.95rem;
  color: var(--ink);
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8f9fc;
}

.input-shell:focus-within {
  border-color: rgba(157, 92, 247, 0.5);
  box-shadow: 0 0 0 4px rgba(157, 92, 247, 0.12);
}

.input-shell input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  width: 100%;
}

.input-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a0b8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 16px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 26px rgba(245, 100, 126, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(245, 100, 126, 0.3);
}

.btn:focus-visible {
  outline: 3px solid rgba(157, 92, 247, 0.35);
  outline-offset: 2px;
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-text {
  background: transparent;
  color: var(--accent-mid);
  padding: 0;
}

.btn-disabled {
  opacity: 0.7;
  pointer-events: none;
}

.hint {
  font-size: 0.95rem;
  color: #8a94ac;
  text-align: center;
}

.auth {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  padding-top: 16px;
}

.auth-hero {
  text-align: center;
  max-width: 520px;
}

.hero-icon {
  width: 86px;
  height: 86px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.hero-icon__mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.avatar-ring {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar-ring::after {
  content: "";
  position: absolute;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #6fa8ad;
  z-index: 0;
}

.avatar-ring svg {
  position: relative;
  z-index: 1;
}

.status-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success);
  bottom: 6px;
  right: 6px;
  border: 3px solid #fff;
  z-index: 2;
}

.profile-email {
  font-size: 1.3rem;
  font-weight: 700;
}

.progress {
  width: 100%;
  height: 14px;
  background: #f1f3f8;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  width: 0;
}

.section-title {
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: #8892a8;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.list-item--manager {
  background: var(--accent);
  border-color: transparent;
}

.list-item--manager .list-item__title,
.list-item--manager .list-item__meta,
.list-item--manager .card-subtitle {
  color: #fff;
}

.list-item__info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.list-item__icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #f7f0f8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-mid);
}

.list-item__title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.list-item__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
}

.status-indicator--muted {
  background: #94a3b8;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-item:first-child {
  border-top: none;
}

.list-item:hover,
.action-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.action-item__info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-item__icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #f0f4fb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.action-item__title {
  font-weight: 700;
}

.action-item__subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.action-item__arrow {
  color: #9aa3b8;
}

.link-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #e11d48;
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.stack-space {
  margin-top: 16px;
}

.auth-card {
  max-width: 480px;
  width: 100%;
}

.domain-form {
  display: grid;
  gap: 16px;
}

.domain-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.badge-count {
  padding: 6px 14px;
  border-radius: 999px;
  background: #fde9f2;
  color: #e11d48;
  font-weight: 700;
}

.token-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.token-row {
  font-family: "Sora", "Segoe UI", Tahoma, sans-serif;
  font-size: 0.95rem;
  background: #f6f7fb;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  word-break: break-all;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  padding: 24px;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  background: var(--surface);
  border-radius: 26px;
  border: 1px solid rgba(231, 236, 243, 0.9);
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal__dialog--compact {
  width: min(560px, 100%);
}

.modal__header {
  padding-right: 40px;
}

.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.plan-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-soft);
}

.plan-card.is-current {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.12);
}

.plan-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-card__title {
  font-weight: 700;
}

.plan-card__price {
  font-size: 1.4rem;
  font-weight: 700;
}

.plan-card__limit {
  color: var(--muted);
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

body.modal-open {
  overflow: hidden;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page > * {
  animation: float-in 0.5s ease both;
}

.page > *:nth-child(2) {
  animation-delay: 0.05s;
}

.page > *:nth-child(3) {
  animation-delay: 0.1s;
}

.page > *:nth-child(4) {
  animation-delay: 0.15s;
}

.auth > * {
  animation: float-in 0.5s ease both;
}

.auth > *:nth-child(2) {
  animation-delay: 0.05s;
}

.auth > *:nth-child(3) {
  animation-delay: 0.1s;
}

@media (max-width: 960px) {
  .app-header__inner {
    padding: 14px 18px;
  }

  .header-actions {
    position: relative;
  }

  .header-toggle {
    display: inline-flex;
  }

  .header-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: min(280px, 90vw);
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    z-index: 40;
  }

  .header-actions.is-open .header-menu {
    display: flex;
  }

  .app-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav-link {
    width: 100%;
  }

  .nav-logout .btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-main {
    padding: 24px 18px 130px;
  }

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

  .card--center {
    padding: 24px 18px;
  }

  .list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .action-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal {
    padding: 14px;
  }

  .modal__dialog {
    padding: 20px;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }
}
