/*
 * Account — page file. Header with avatar, the mood panel, then two panels
 * (profile with the picture uploader, password). Sign out lives in the header.
 */

.account {
  max-width: 960px;
  margin: 0 auto;
}

.account__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.account__header .text-caption {
  margin: var(--space-1) 0 var(--space-2);
}

.account__panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.account__form {
  display: flex;
  flex-direction: column;
}

/* ---- Picture uploader (image-upload controller) ---- */

.account__uploader {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background-color: var(--color-deep-night);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-comfortable);
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.account__uploader--dragging {
  border-color: var(--color-purple);
  background-color: color-mix(in srgb, var(--color-purple) 10%, var(--color-deep-night));
  box-shadow: var(--glow-purple);
}

.account__uploader--chosen {
  border-style: solid;
  border-color: color-mix(in srgb, var(--color-purple) 55%, transparent);
}

.account__uploader-preview {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
}

/* Marks the preview as not saved yet. */
.account__uploader--chosen .account__uploader-preview::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--color-purple);
  border-radius: var(--radius-circle);
}

.account__uploader-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  min-width: 0;
}

.account__uploader-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.account__uploader-browse {
  width: auto;
}

.account__uploader-or,
.account__uploader-status {
  font-size: var(--text-md);
  color: var(--color-comment);
}

.account__uploader-status {
  margin: 0;
  overflow-wrap: anywhere;
}

.account__uploader--chosen .account__uploader-status {
  color: var(--color-foreground);
}

.account__uploader-undo {
  padding: 0;
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--color-purple);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.account__uploader-undo:hover {
  text-decoration: underline;
}

/* Phones: no dragging, so only the button is offered. */
@media (max-width: 639px) {
  .account__uploader {
    align-items: flex-start;
  }

  .account__uploader-or {
    display: none;
  }
}

.account__mood {
  margin-bottom: var(--space-4);
}

.account__actions {
  margin-top: var(--space-6);
}

.account__actions .btn {
  width: auto;
}

@media (min-width: 1024px) {
  .account__panels {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ---- Profile theme (specs/006 US2, contracts/ui-profile-themes.md §4) ---- */

/* Room between the Profile and Password panels and this section. */
.account__profile-theme {
  margin-top: var(--space-6);
}

.account__profile-theme-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* A phone: the preview, then the choices. From 1024px the preview stays in view beside them. */
.profile-theme-form__layout {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 1024px) {
  .profile-theme-form__layout {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    align-items: start;
  }

  .profile-theme-form__preview {
    position: sticky;
    top: var(--space-4);
  }
}

.profile-theme-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 360px;
}

.profile-card--preview {
  padding-bottom: var(--space-2);
  background-color: var(--color-deep-night);
  border-radius: var(--radius-comfortable);
}

.profile-card--preview .profile-card__banner {
  border-radius: var(--radius-comfortable) var(--radius-comfortable) 0 0;
}

.profile-theme-form__choices {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.profile-theme-form__empty,
.profile-theme-form__shop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-md);
  color: var(--color-comment);
}

.profile-theme-form__empty {
  padding: var(--space-3);
  background-color: var(--color-card);
  border-radius: var(--radius-standard);
}

.profile-theme-form__shop a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.profile-theme-form__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.profile-theme-form__legend {
  margin-bottom: var(--space-1);
  padding: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-badge);
  color: var(--color-comment);
  text-transform: uppercase;
}

.profile-theme-form__presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.profile-theme-form__presets .btn,
.profile-theme-form__actions .btn {
  width: auto;
}

.profile-theme-place__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.profile-theme-place__row .input {
  flex: 1;
  min-width: 0;
}

.profile-theme-form__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
