/* ==========================================================================
   Alkando — account.

   Two states in one page, swapped by account.js:
     signed out   the sign-in card
     signed in    subscription, sign-in details, connected accounts

   Nothing here talks to Firebase yet — it is the look, with placeholder
   values. The lists are the app's settings lists: a solid card in raised
   indigo (ThemeTokens.alkandoBrand.cellBg), hairline separators at white
   10%, and a chevron where a row leads somewhere.
   ========================================================================== */

/* The app paints every screen with the brand gradient
   (alkandoScreenBackground); the site's older pages use a near-black
   radial. This page follows the app. */
html[data-page="account"] body {
  background:
    linear-gradient(135deg, var(--ak-ink-1) 0%, var(--ak-ink-2) 55%, var(--ak-ink-3) 100%)
    fixed;
}

.account {
  width: 100%;
  max-width: 560px;
  /* Clears the fixed header. */
  margin: 0 auto;
  padding: 122px 20px 64px;
}

/* --- shared pieces --- */

.acc-card {
  border-radius: var(--ak-radius-card);
  background: var(--ak-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.acc-section {
  margin: 26px 4px 8px;
  color: var(--ak-section);
  font: 800 11px/1 var(--ak-font-ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.acc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  border: 0;
  background: none;
  color: var(--ak-text);
  font: 400 15px/1.3 var(--ak-font-ui);
  text-align: left;
  text-decoration: none;
}

.acc-row + .acc-row {
  /* Hairline inset to the label, the way grouped lists are drawn. */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.acc-row__label {
  flex-shrink: 0;
  color: var(--ak-text-2);
}

.acc-row__value {
  margin-left: auto;
  overflow: hidden;
  color: var(--ak-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-row__action {
  margin-left: auto;
  flex-shrink: 0;
  /* It is a <button>: without these it keeps the platform's own grey box. */
  padding: 0;
  border: 0;
  background: none;
  color: var(--ak-accent);
  font: 600 15px/1.3 var(--ak-font-ui);
  cursor: pointer;
}

.acc-chevron {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  stroke: var(--ak-text-3);
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.acc-logo {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
}

/* --- signed in: who --- */

.acc-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  padding: 4px;
}

.acc-avatar {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ak-indigo), var(--ak-violet));
  color: #fff;
  font: 700 25px/1 var(--ak-font-rounded);
  box-shadow: 0 8px 22px rgba(66, 54, 204, 0.4);
}

.acc-identity__mail {
  display: block;
  min-width: 0;
  overflow: hidden;
  font: 600 17px/1.2 var(--ak-font-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-identity__since {
  display: block;
  margin-top: 4px;
  color: var(--ak-text-3);
  font: 400 13px/1 var(--ak-font-ui);
}

/* --- subscription --- */

.acc-plan {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
}

.acc-plan__name {
  font: 700 19px/1 var(--ak-font-rounded);
}

.acc-chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ak-text-2);
  font: 700 11px/1 var(--ak-font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- buttons --- */

.acc-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--ak-radius-button);
  /* Onboarding's primary button. */
  background: linear-gradient(90deg, var(--ak-indigo), var(--ak-violet));
  color: #fff;
  font: 700 16px/1 var(--ak-font-ui);
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(112, 88, 255, 0.34);
  transition: transform var(--ak-dur-tap) var(--ak-ease-out);
}

.acc-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--ak-radius-button);
  background: #fff;
  color: var(--ak-on-white);
  font: 600 16px/1 var(--ak-font-ui);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ak-dur-tap) var(--ak-ease-out);
}

.acc-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  margin-top: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--ak-radius-button);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ak-text);
  font: 600 15px/1 var(--ak-font-ui);
  cursor: pointer;
  transition: transform var(--ak-dur-tap) var(--ak-ease-out);
}

.acc-primary:active,
.acc-provider:active,
.acc-ghost:active {
  transform: scale(0.98);
}

/* --- sign-in card --- */

.acc-signin {
  max-width: 420px;
  margin: 0 auto;
  padding: 28px 24px 26px;
  border-radius: var(--ak-radius-panel);
  background: var(--ak-glass-fill);
  border: 1px solid var(--ak-glass-stroke);
  backdrop-filter: var(--ak-glass-blur);
  -webkit-backdrop-filter: var(--ak-glass-blur);
  box-shadow: 0 26px 60px rgba(8, 4, 24, 0.42);
  text-align: center;
}

.acc-signin img {
  width: 62px;
  height: 62px;
  border-radius: 22.37%;
}

.acc-signin h1 {
  margin: 14px 0 22px;
  font: 800 26px/1.15 var(--ak-font-rounded);
  letter-spacing: -0.01em;
}

.acc-providers {
  display: grid;
  gap: 10px;
}

/* "or" with a rule either side. */
.acc-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--ak-text-3);
  font: 500 13px/1 var(--ak-font-ui);
}

.acc-or::before,
.acc-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

/* A <label> is inline by default, and inline boxes ignore vertical margins:
   without display: block the gap below each field silently collapses to
   nothing and the next label sits flush on the input above it. */
.acc-field {
  display: block;
  margin-bottom: 14px;
  text-align: left;
}

.acc-field span {
  display: block;
  /* Flush with the field's edge, like the buttons above it. */
  margin: 0 0 7px;
  color: var(--ak-text-2);
  font: 600 12.5px/1 var(--ak-font-ui);
}

.acc-field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--ak-radius-button);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ak-text);
  font: 400 16px/1 var(--ak-font-ui);
}

.acc-field input::placeholder {
  color: var(--ak-text-3);
}

.acc-field input:focus-visible {
  outline: 2px solid var(--ak-accent);
  outline-offset: 1px;
}

/* The last field's own 14px plus this: the action sits clearly apart from
   the inputs instead of reading as a third one. */
.acc-signin .acc-primary {
  margin-top: 22px;
}

.acc-signin .acc-field:last-of-type {
  margin-bottom: 0;
}

.acc-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font: 600 13.5px/1 var(--ak-font-ui);
}

.acc-links a {
  color: var(--ak-text-2);
  text-decoration: none;
}

.acc-links a:hover {
  color: var(--ak-text);
}

.account a:focus-visible,
.account button:focus-visible {
  outline: 2px solid var(--ak-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .acc-primary,
  .acc-provider,
  .acc-ghost {
    transition: none;
  }
}

@media (max-width: 520px) {
  .account {
    padding-top: 104px;
  }
}

/* --- connected to Firebase --- */

.acc-msg {
  margin: 16px 0 0;
  color: var(--ak-text-2);
  font: 500 14px/1.45 var(--ak-font-ui);
}

.acc-msg[data-kind="error"] {
  color: #ff8a9c;
}

.acc-note {
  margin: 0 0 14px;
  color: var(--ak-text-2);
  font: 400 15px/1.5 var(--ak-font-ui);
}

.acc-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--ak-radius-button);
  background: #d92d4a;
  color: #fff;
  font: 700 15px/1 var(--ak-font-ui);
  cursor: pointer;
  transition: transform var(--ak-dur-tap) var(--ak-ease-out);
}

.acc-danger:active {
  transform: scale(0.97);
}

.acc-danger:disabled {
  opacity: 0.6;
}

.acc-delete {
  padding: 16px;
}

.acc-inline {
  align-items: flex-end;
  gap: 12px;
}

.acc-inline .acc-field {
  flex: 1;
  margin: 0;
}

.acc-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(217, 45, 74, 0.18);
}

.acc-banner p {
  margin: 0;
  font: 600 14.5px/1.4 var(--ak-font-ui);
}

/* Rows and the banner set their own display; hidden has to win over it. */
.account [hidden] {
  display: none !important;
}

.acc-danger:disabled {
  cursor: not-allowed;
}

[data-state="delete-choice"] .acc-field {
  margin-bottom: 14px;
}

.acc-note a {
  color: inherit;
  text-decoration: underline;
}

/* Buttons of a choice: one even gap, whatever the single-button margins are. */
.acc-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.acc-stack .acc-ghost {
  margin-top: 0;
}

.acc-note--strong {
  margin: 0 0 4px;
  color: var(--ak-text);
  font-weight: 600;
}

.acc-delete .acc-note:last-of-type {
  margin-bottom: 14px;
}

