/* =====================================================================
   Algaita — Login, register and password pages
===================================================================== */

:root {
  --au-bg: #0b0d12;
  --au-surface: #141822;
  --au-surface-2: #1c2130;
  --au-line: rgba(255, 255, 255, 0.09);
  --au-text: #f4f5f7;
  --au-muted: #9aa3b5;
  --au-accent: #f5b301;
  --au-accent-hover: #ffc933;
  --au-accent-ink: #15130c;
  --au-danger: #f87171;
  --au-success: #4ade80;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

.au-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(245, 179, 1, 0.12) 0%, rgba(245, 179, 1, 0) 70%),
    var(--au-bg);
  color: var(--au-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.au-icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: block;
}

.au-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 14px calc(24px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Card ---------- */
.au-card {
  width: 100%;
  max-width: 440px;
  padding: 24px 20px;
  border: 1px solid var(--au-line);
  border-radius: 22px;
  background: var(--au-surface);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.au-card.is-wide {
  max-width: 540px;
}

.au-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.au-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--au-surface-2);
}

.au-head {
  margin: 22px 0 20px;
  text-align: center;
}

.au-head-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(245, 179, 1, 0.14);
  color: var(--au-accent);
}

.au-head-icon .au-icon {
  width: 24px;
  height: 24px;
}

.au-head h1 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.au-head p {
  margin: 0;
  color: var(--au-muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- Notices ---------- */
.au-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.au-notice .au-icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.au-notice a {
  margin-left: 4px;
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
}

.au-notice.is-error {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.au-notice.is-success {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.au-notice.is-info {
  border-color: rgba(245, 179, 1, 0.35);
  background: rgba(245, 179, 1, 0.1);
  color: #fde68a;
}

/* ---------- Form ---------- */
.au-form {
  margin: 0;
}

.au-row {
  display: grid;
  gap: 0 12px;
}

.au-field {
  margin-bottom: 14px;
}

.au-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.au-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--au-text);
  font-size: 13.5px;
  font-weight: 700;
}

.au-label-row a {
  color: var(--au-accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.au-label-row a:hover {
  text-decoration: underline;
}

.au-input {
  position: relative;
}

.au-input > .au-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  color: var(--au-muted);
  pointer-events: none;
}

/* 16px stops iPhones zooming in */
.au-input input {
  width: 100%;
  height: 50px;
  margin: 0;
  padding: 0 14px 0 44px;
  border: 1px solid var(--au-line);
  border-radius: 12px;
  background: var(--au-surface-2);
  color: var(--au-text);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.au-input input::placeholder {
  color: #6b7385;
}

.au-input input:focus {
  border-color: rgba(245, 179, 1, 0.65);
  outline: none;
  box-shadow: 0 0 0 4px rgba(245, 179, 1, 0.13);
}

.au-input input[aria-invalid="true"] {
  border-color: rgba(248, 113, 113, 0.6);
}

/* Autofill: keep the dark look */
.au-input input:-webkit-autofill {
  -webkit-text-fill-color: var(--au-text);
  box-shadow: 0 0 0 1000px var(--au-surface-2) inset;
  caret-color: var(--au-text);
}

.au-input.has-toggle input {
  padding-right: 50px;
}

.au-eye {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--au-muted);
  cursor: pointer;
}

.au-eye:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.au-eye .au-icon {
  width: 19px;
  height: 19px;
}

.au-eye .is-off,
.au-eye[aria-pressed="true"] .is-on {
  display: none;
}

.au-eye[aria-pressed="true"] .is-off {
  display: block;
}

.au-hint {
  margin: 6px 0 0;
  color: var(--au-muted);
  font-size: 12.5px;
}

.au-hint.is-bad {
  color: var(--au-danger);
}

.au-hint.is-good {
  color: var(--au-success);
}

.au-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--au-accent);
  color: var(--au-accent-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s;
}

.au-submit:hover {
  background: var(--au-accent-hover);
}

.au-submit:active {
  transform: scale(0.99);
}

.au-submit[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.au-submit .au-icon {
  width: 19px;
  height: 19px;
}

/* ---------- Links under the form ---------- */
.au-alt {
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--au-line);
  color: var(--au-muted);
  font-size: 14px;
  text-align: center;
}

.au-alt a {
  color: var(--au-accent);
  font-weight: 800;
  text-decoration: none;
}

.au-alt a:hover {
  text-decoration: underline;
}

.au-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--au-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.au-back:hover {
  color: #fff;
}

.au-back .au-icon {
  width: 17px;
  height: 17px;
}

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

/* ---------- Larger screens ---------- */
@media (min-width: 520px) {
  .au-card {
    padding: 32px 30px;
  }

  .au-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-height: 700px) {
  .au-wrap {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
