/* Edit profile — full-screen page.
   Visual language mirrored on the earnings-home surface:
   white background, dark ink text (#1a1b26), light outline (#c5c4db),
   NO pink surfaces, NO coloured glow. Pink is kept as a signal colour only
   (focus caret, over-limit counter). */

/* Transitions.dev motion tokens — scoped to the edit-profile screen. */
.ep-page {
  --ep-enter-dur: 320ms;
  --ep-enter-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ep-check-dur: 420ms;
  --ep-check-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ep-fg: #1a1b26;
  --ep-fg-variant: #454558;
  --ep-outline: #c5c4db;
  --ep-outline-soft: rgba(26,27,38,0.08);
  --ep-surface: #ffffff;
  --ep-field-bg: #ffffff;
  --ep-ink: #1a1b26;
  --ep-accent: #FF2D8C;
  min-height: 100vh;
  background: var(--ep-surface);
  color: var(--ep-fg);
  font-family: var(--font-sans), 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: 48px;
}

/* ---- sticky header ---------------------------------------------------- */
.ep-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--ep-surface) 85%, transparent);
  border-bottom: 1px solid var(--ep-outline-soft);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}
.ep-back {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--ep-fg);
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
}
.ep-back:hover { background: #f3f4f6; }
.ep-back:active { transform: scale(0.94); }

.ep-title {
  flex: 1; margin: 0;
  font-size: 1.0625rem; line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ep-fg);
}

.ep-save {
  position: relative;
  background: var(--ep-ink);
  color: #fff; border: 0;
  border-radius: 999px;
  padding: 0 20px; height: 36px; min-width: 76px;
  font-size: 0.875rem; font-weight: 650;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: transform 120ms ease, background 150ms ease;
}
.ep-save:hover { background: #000; }
.ep-save:active { transform: scale(0.96); }
.ep-save[data-state="done"] { pointer-events: none; }

.ep-save-label,
.ep-save-check {
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 180ms var(--ep-check-ease), transform 180ms var(--ep-check-ease);
}
.ep-save-check {
  position: absolute; inset: 0;
  opacity: 0; transform: scale(0.6);
}
.ep-save-check svg path {
  stroke-dasharray: 28; stroke-dashoffset: 28;
}
.ep-save[data-state="done"] .ep-save-label { opacity: 0; transform: scale(0.8); }
.ep-save[data-state="done"] .ep-save-check { opacity: 1; transform: scale(1); }
.ep-save[data-state="done"] .ep-save-check svg path {
  animation: ep-check-draw var(--ep-check-dur) var(--ep-check-ease) 60ms forwards;
}
@keyframes ep-check-draw { to { stroke-dashoffset: 0; } }

/* Page entrance — fade + small rise. */
.ep-page[data-ep-enter="out"] {
  opacity: 0;
  transform: translateY(6px);
}
.ep-page[data-ep-enter="in"] {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity   var(--ep-enter-dur) var(--ep-enter-ease),
    transform var(--ep-enter-dur) var(--ep-enter-ease);
}
@media (prefers-reduced-motion: reduce) {
  .ep-page[data-ep-enter="out"] { opacity: 1; transform: none; }
  .ep-page[data-ep-enter="in"]  { transition: none; }
  .ep-save-check svg path { animation: none !important; stroke-dashoffset: 0 !important; }
  .ep-save-label, .ep-save-check { transition: none !important; }
}

/* ---- media: banner + overlapping avatar ------------------------------ */
.ep-media {
  position: relative;
  margin-bottom: 60px;
}
.ep-banner {
  display: block;
  width: 100%; aspect-ratio: 3 / 1;
  background: #d4d4d8;
  background-size: cover; background-position: center;
  cursor: pointer; position: relative;
  overflow: hidden;
}
.ep-banner::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,0.32);
  transition: background 180ms ease;
}
.ep-banner:hover::after,
.ep-avatar:hover::after { background: rgba(0,0,0,0.44); }

.ep-camera-btn {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(15,16,22,0.65);
  color: #fff;
  z-index: 2;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 150ms ease, transform 120ms ease;
}
.ep-banner:hover .ep-camera-btn,
.ep-avatar:hover .ep-camera-btn { background: rgba(15,16,22,0.82); }
.ep-camera-btn:active { transform: translate(-50%,-50%) scale(0.94); }
.ep-camera-btn--sm { width: 36px; height: 36px; }
.ep-camera-btn--sm svg { width: 18px; height: 18px; }

/* avatar: overlaps banner at bottom-left, half out */
.ep-avatar {
  position: absolute;
  left: 18px;
  bottom: -52px;
  width: 112px; height: 112px;
  border-radius: 50%;
  background: #d4d4d8;
  background-size: cover; background-position: center;
  border: 4px solid var(--ep-surface);
  cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ep-avatar::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,0.32);
  transition: background 180ms ease;
}
.ep-avatar-initials {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #1a1b26;
  font-family: var(--font-num, var(--font-sans));
  font-size: 2rem; font-weight: 650;
  letter-spacing: -0.02em;
  color: #fff;
  z-index: 0;
}

/* ---- form: outlined inputs, no colored fills ------------------------- */
.ep-form {
  padding: 24px 20px 0;
  display: flex; flex-direction: column; gap: 16px;
}
.ep-field {
  display: block; position: relative;
  background: var(--ep-field-bg);
  border: 1px solid var(--ep-outline);
  border-radius: 12px;
  padding: 10px 14px 8px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.ep-field:focus-within {
  border-color: var(--ep-ink);
  box-shadow: 0 0 0 1px var(--ep-ink);
}

.ep-label {
  display: block;
  font-size: 0.75rem; line-height: 1;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ep-fg-variant);
  margin-bottom: 4px;
}

.ep-input {
  width: 100%; border: 0; outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9375rem; line-height: 1.4;
  font-weight: 500;
  color: var(--ep-fg);
  padding: 0;
}
.ep-input::placeholder { color: var(--ep-fg-variant); opacity: 0.6; }
.ep-textarea { resize: vertical; min-height: 68px; max-height: 240px; }

.ep-counter {
  position: absolute; right: 12px; bottom: 8px;
  font-family: var(--font-num, var(--font-sans));
  font-size: 0.75rem; font-weight: 500;
  color: var(--ep-fg-variant);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0.7;
}

/* handle: @ prefix inline, inside the same outlined box */
.ep-handle-wrap {
  display: flex; align-items: center; gap: 2px;
  padding: 0 !important; background: transparent !important;
  border: 0 !important; box-shadow: none !important;
}
.ep-handle-at {
  color: var(--ep-fg-variant);
  font-size: 0.9375rem; font-weight: 500;
}
.ep-handle-input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 0.9375rem; line-height: 1.4;
  font-weight: 500;
  color: var(--ep-fg);
  padding: 0;
}

/* Locked handle: read-only, no caret, lock glyph on the right. */
.ep-field--locked { cursor: default; }
.ep-field--locked:focus-within { border-color: var(--ep-outline); box-shadow: none; }
.ep-handle-static {
  flex: 1;
  font-size: 0.9375rem; line-height: 1.4;
  font-weight: 500;
  color: var(--ep-fg);
  user-select: text;
}
.ep-lock {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ep-fg-variant);
  opacity: 0.75;
  margin-left: 8px;
}

/* ---- phones ----------------------------------------------------------- */
@media (max-width: 480px) {
  .ep-head { padding: 12px 16px; }
  .ep-form { padding: 20px 16px 0; }
  .ep-avatar { width: 96px; height: 96px; bottom: -44px; left: 16px; border-width: 3px; }
  .ep-camera-btn { width: 38px; height: 38px; }
  .ep-media { margin-bottom: 52px; }
}
