/* =========================================================================
   AUTH.CSS — login + register (accounts/login.html, accounts/register.html)
   Builds on site.css tokens.
   ========================================================================= */

.au {
  position: relative;
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  align-items: center;
  padding: 3rem 0;
  overflow: hidden;
  isolation: isolate;
}

.au-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(50% 60% at 15% 20%, rgba(239, 68, 68, 0.18), transparent 60%),
    radial-gradient(40% 50% at 90% 90%, rgba(251, 146, 60, 0.07), transparent 60%);
}
.au-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(60% 70% at 40% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 70% at 40% 40%, #000 20%, transparent 75%);
}

.au-shell {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 992px) {
  .au-shell { grid-template-columns: 1fr 440px; gap: 4rem; }
}

/* ---------- Brand side (desktop only) ---------- */
.au-badge {
  display: inline-flex; align-items: center; gap: 0.55rem; height: 30px; padding: 0 0.85rem;
  border-radius: 999px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.04);
  font-size: 0.8rem; font-weight: 500; color: var(--text-2);
}
.au-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.au-brand { display: none; position: relative; }
@media (min-width: 992px) { .au-brand { display: block; } }

.au-brand::after {
  content: '';
  position: absolute;
  right: -2rem;
  bottom: -4rem;
  width: 70%;
  aspect-ratio: 1;
  z-index: -1;
  background: url('../images/index_scene.png') no-repeat center / contain;
  filter: invert(1);
  opacity: 0.045;
}

.au-brand-title {
  margin: 1.1rem 0 1rem;
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.au-brand-title span {
  background: linear-gradient(100deg, #f87171, #ef4444 40%, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.au-brand-lead { max-width: 28rem; margin: 0 0 2rem; color: var(--text-2); font-size: 1.05rem; line-height: 1.6; }

.au-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.au-points li { display: flex; align-items: center; gap: 0.85rem; color: var(--text-2); font-size: 0.95rem; }
.au-points i {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  color: #fca5a5;
}

/* ---------- Card ---------- */
.au-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.au-logo { display: block; height: 52px; width: auto; margin-bottom: 1.5rem; filter: invert(1); }
.au-title { margin: 0 0 0.35rem; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.au-sub { margin: 0 0 1.75rem; color: var(--text-2); font-size: 0.925rem; }

/* Alerts */
.au-alert {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.45;
  background: var(--accent-soft);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fecaca;
}
.au-alert i { margin-top: 0.1rem; }
.au-alert ul { margin: 0; padding: 0; list-style: none; }
.au-alert-success { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.3); color: #bbf7d0; }
.au-alert-info    { background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.3); color: #bfdbfe; }

/* Fields */
.au-form { display: grid; gap: 1.1rem; }
.au-field { display: grid; gap: 0.45rem; }
.au-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.85rem; font-weight: 500; color: var(--text); }
.au-label small { font-weight: 400; color: var(--text-3); }

.au-input { position: relative; }
.au-input > i {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  transition: color 0.15s;
}
.au-input input,
.au-form .au-input input.form-control {
  width: 100%;
  height: 46px;
  padding: 0 1rem 0 2.6rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.au-input input::placeholder { color: var(--text-3); }
.au-input input:focus { outline: none; border-color: var(--accent); background: var(--bg); color: var(--text); box-shadow: 0 0 0 4px var(--accent-soft); }
.au-input:focus-within > i { color: var(--text); }
.au-input input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 100px var(--surface-2) inset;
  caret-color: var(--text);
}
.au-field.has-error .au-input input { border-color: rgba(239, 68, 68, 0.6); }
.au-error { font-size: 0.8rem; color: #fca5a5; }
.au-hint { font-size: 0.78rem; line-height: 1.45; color: var(--text-3); }

/* Password reveal */
.au-input .au-reveal {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.au-input .au-reveal:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.au-input.has-reveal input { padding-right: 2.9rem; }

/* File input */
.au-file {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s;
}
.au-file:hover { border-color: var(--text-3); }
.au-file-preview {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2) center / cover no-repeat;
  color: var(--text-3);
  font-size: 1.1rem;
}
.au-file-text { min-width: 0; font-size: 0.85rem; color: var(--text-2); }
.au-file-text strong { display: block; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-file input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Checkbox */
.au-check { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.875rem; color: var(--text-2); cursor: pointer; user-select: none; }
.au-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.au-check input::after {
  content: '';
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.12s var(--ease);
}
.au-check input:checked { background: var(--accent-strong); border-color: var(--accent-strong); }
.au-check input:checked::after { transform: rotate(-45deg) scale(1); }

.au-submit { width: 100%; height: 48px; margin-top: 0.25rem; font-size: 0.95rem; }
.au-submit[disabled] { opacity: 0.7; cursor: progress; }

.au-switch {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-2);
}
.au-switch a { color: var(--text); font-weight: 600; text-decoration: none; }
.au-switch a:hover { color: #fca5a5; }

.au-two { display: grid; gap: 1.1rem; }
@media (min-width: 480px) { .au-two { grid-template-columns: 1fr 1fr; } }

@media (max-width: 575.98px) {
  .au { padding: 1.5rem 0 2rem; align-items: flex-start; }
  .au-card { padding: 1.5rem 1.25rem; border-radius: 20px; }
}
