/* Accounts screens. Components use token names only (orbit-tokens.css is loaded first).
   The accent is Plum, the default for the accounts service. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.shell {
  box-sizing: border-box;
  max-width: var(--content-w);
  margin: 0 auto;
  min-height: 100dvh;
  padding: var(--space-6) var(--space-4);
  padding-top: calc(var(--space-6) + env(safe-area-inset-top));
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  padding-left: calc(var(--space-4) + env(safe-area-inset-left));
  padding-right: calc(var(--space-4) + env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 48rem) {
  .shell { padding-left: var(--space-5); padding-right: var(--space-5); }
}

.wordmark {
  margin: 0;
  font-size: var(--fs-title-2);
  line-height: var(--lh-title-2);
  font-weight: 800;
  letter-spacing: -0.01em;
}

h1 {
  margin: 0;
  font-size: var(--fs-title-1);
  line-height: var(--lh-title-1);
  font-weight: 700;
}

p { margin: 0; }

.secondary {
  font-size: var(--fs-secondary);
  line-height: var(--lh-secondary);
  color: var(--text-2);
}

.caption {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 500;
  color: var(--text-2);
}

.credit { color: var(--text-2); text-decoration: none; }

.strong { font-weight: 600; overflow-wrap: anywhere; }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }

.card {
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Buttons: lozenges, 48px high */
.btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  padding: 0 var(--space-5);
  border: var(--border-w) solid transparent;
  border-radius: var(--radius-pill);
  font: 600 var(--fs-body)/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}

.stack .btn { width: 100%; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-pressed); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-input);
}
.btn-secondary:active { background: var(--surface-2); }

.btn-tertiary { background: transparent; color: var(--accent); align-self: flex-start; }

@media (hover: hover) {
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-secondary:hover { background: var(--surface-2); }
  .btn-tertiary:hover { background: var(--surface-2); }
}

/* Loading: keep the width, replace the label with a spinner */
.btn.is-loading { position: relative; cursor: progress; }
.btn.is-loading .btn-label { visibility: hidden; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: var(--space-4);
  height: var(--space-4);
  border: var(--ring) solid currentColor;
  border-right-color: transparent;
  border-radius: var(--radius-pill);
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Fields */
.field { display: flex; flex-direction: column; gap: var(--space-2); }

label {
  font-size: var(--fs-secondary);
  line-height: var(--lh-secondary);
  font-weight: 600;
  color: var(--text);
}

input {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--control-h);
  padding: 0 var(--space-4);
  background: var(--surface);
  color: var(--text);
  border: var(--border-w) solid var(--border-input);
  border-radius: var(--radius-field);
  font: 400 var(--fs-body)/var(--lh-body) var(--font);
}

input:focus { border-color: var(--text); }

.helper {
  font-size: var(--fs-secondary);
  line-height: var(--lh-secondary);
  color: var(--text-2);
}

/* Errors: icon plus message, never colour alone */
.field-error,
.message {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--fs-secondary);
  line-height: var(--lh-secondary);
  color: var(--err);
}

.field-error[hidden],
.message[hidden] { display: none; }

.message {
  padding: var(--space-3) var(--space-4);
  background: var(--err-bg);
  border-radius: var(--radius-field);
}

.icon { flex: none; margin-top: var(--space-1); }

input[aria-invalid="true"] { border-color: var(--err); }
