:root {
  color-scheme: light;
}

body.profile-page {
  background: var(--bg);
  color: var(--text);
  padding: 32px 18px 48px;
}

.profile-wrap {
  width: min(860px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(17, 60, 76, 0.18);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.profile-back:hover {
  border-color: rgba(17, 60, 76, 0.35);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.profile-back:active {
  transform: translateY(0);
}

.profile-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-title h1 {
  margin: 0;
}

.profile-title p {
  margin: 0;
  color: var(--muted);
}

.profile-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

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

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.profile-value {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.profile-help {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.profile-field input {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.06);
}

.profile-field input:focus {
  outline: none;
  border-color: rgba(17, 60, 76, 0.45);
  box-shadow: 0 0 0 3px rgba(17, 60, 76, 0.12);
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-status {
  font-size: 12px;
  color: var(--muted);
}

.profile-status[data-tone="error"] {
  color: var(--error);
}

.profile-status[data-tone="success"] {
  color: var(--success);
}

.profile-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-login h2 {
  margin: 0 0 6px;
}

.profile-login p {
  margin: 0 0 14px;
  color: var(--muted);
}

.profile-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(17, 60, 76, 0.2);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.profile-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(17, 60, 76, 0.3);
}

.profile-primary:active {
  transform: translateY(0);
}

.profile-danger {
  border: 1px solid rgba(220, 38, 38, 0.18);
  background: rgba(254, 242, 242, 0.7);
}

.profile-danger h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.profile-danger p {
  margin: 0 0 14px;
  color: var(--muted);
}

.profile-danger-button {
  background: #dc2626;
  color: #fff;
  border: 1px solid rgba(185, 28, 28, 0.6);
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.25);
}

.profile-danger-button:hover {
  border-color: rgba(153, 27, 27, 0.8);
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.35);
}

.profile-danger-button:active {
  transform: translateY(0);
}

.profile-danger-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 700px) {
  .profile-wrap {
    gap: 16px;
  }

  .profile-card {
    padding: 16px;
  }

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