:root {
  color-scheme: dark light;
  --bg: radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 60%), #050914;
  --surface: rgba(15, 23, 42, 0.88);
  --panel: rgba(30, 41, 59, 0.92);
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --text: #e2e8f0;
  --muted: #8da2c2;
  --danger: #fb7185;
  --border: rgba(148, 163, 184, 0.25);
  --shadow: 0 24px 48px rgba(2, 6, 23, 0.5);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.6;
}

.profile-shell {
  width: min(820px, 90vw);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 3rem;
  display: grid;
  gap: clamp(1.5rem, 4vw, 2rem);
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.profile-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

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

.profile-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.button--primary {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(14, 165, 233, 0.95));
  color: #04111b;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 18px 38px rgba(14, 165, 233, 0.35);
}

.button--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button--ghost:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.16);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.profile-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}

form {
  display: grid;
  gap: 1.5rem;
}

fieldset {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

legend {
  padding: 0 0.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--muted);
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
}

input,
textarea {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.45);
  outline-offset: 2px;
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.25);
}

textarea {
  resize: vertical;
  min-height: 5.5rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-feedback {
  margin: 0;
  min-height: 1.2rem;
  color: var(--muted);
}

.form-feedback[data-state='error'] {
  color: var(--danger);
}

.form-feedback[data-state='success'] {
  color: #34d399;
}

@media (max-width: 640px) {
  .profile-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
