/* ============================================================
   AndroBase — Login page theme (by 13bravo)
   Static, lightweight. No continuous animations.
   ============================================================ */

/* ---------- Chrome password autofill fix (dark theme) ---------- */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset !important;
  caret-color: var(--text);
  border-color: var(--gold-deep);
  transition: background-color 9999999s ease-in-out 0s;
}

/* ---------- Static background ---------- */
.lg-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 20% -10%, color-mix(in oklch, var(--gold) 8%, transparent), transparent 60%),
    radial-gradient(ellipse 80% 55% at 85% 15%, color-mix(in oklch, var(--patina) 7%, transparent), transparent 60%),
    var(--bg);
}

/* ---------- Static orbs (soft gradient only) ---------- */
.lg-orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.28;
  pointer-events: none;
}

.lg-orb-1 {
  width: 380px; height: 380px;
  top: -140px; left: -120px;
  background: radial-gradient(circle, color-mix(in oklch, var(--gold) 28%, transparent), transparent 68%);
}

.lg-orb-2 {
  width: 340px; height: 340px;
  bottom: -160px; right: -130px;
  background: radial-gradient(circle, color-mix(in oklch, var(--patina) 24%, transparent), transparent 68%);
}

.lg-orb-3 { display: none; }

/* ---------- Static lab grid ---------- */
.lg-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(color-mix(in oklch, var(--gold-pale) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklch, var(--gold-pale) 4%, transparent) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, black 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, black 30%, transparent 78%);
  opacity: 0.5;
}

/* ---------- Particles canvas (fixed, out of flow) ---------- */
.lg-particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Panel ---------- */
.lg-panel {
  position: relative;
  z-index: 2;
  margin: auto;
  padding: 0.8rem 1.4rem 1rem;
  max-width: 430px;
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--gold) 4%, transparent), transparent 34%),
    color-mix(in oklch, var(--surface) 94%, transparent);
  border: 1px solid color-mix(in oklch, var(--gold) 26%, var(--border-strong));
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--gold) 6%, transparent) inset,
    0 30px 70px -22px oklch(0% 0 0 / 0.7);
  animation: lg-panel-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lg-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in oklch, var(--gold) 55%, transparent), transparent);
  pointer-events: none;
}

@keyframes lg-panel-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Logo ring ---------- */
.lg-logo-ring {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 auto 0.25rem;
  display: grid;
  place-items: center;
}

.lg-logo-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in oklch, var(--gold) 45%, transparent);
  box-shadow: 0 0 14px -6px color-mix(in oklch, var(--gold) 35%, transparent);
}

.lg-logo-ring img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  z-index: 1;
}

/* ---------- Heading ---------- */
.lg-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--heading);
}

/* ---------- Tabs ---------- */
.lg-tab {
  position: relative;
  background: none;
  border: none;
  padding: 0.4rem 1.1rem 0.45rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.lg-tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.lg-tab:hover { color: var(--text); }
.lg-tab.active { color: var(--gold-pale); }
.lg-tab.active::after { transform: scaleX(1); }

/* ---------- Inputs ---------- */
.lg-input {
  width: 100%;
  background: color-mix(in oklch, var(--bg) 60%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1.02rem;
  padding: 0.6rem 0.9rem;
  text-align: center;
  letter-spacing: 0.04em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lg-input::placeholder { color: var(--text-faint); }

.lg-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--gold) 15%, transparent);
}

/* ---------- Buttons ---------- */
.lg-btn {
  position: relative;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid color-mix(in oklch, var(--gold) 70%, var(--gold-deep));
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--gold), color-mix(in oklch, var(--gold) 72%, var(--gold-deep)));
  color: var(--bg);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.lg-btn::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-sm) - 1px);
  background: linear-gradient(180deg, oklch(100% 0 0 / 0.22), transparent 55%);
  pointer-events: none;
}

.lg-btn:hover:not(:disabled) { filter: brightness(1.08); }
.lg-btn:active:not(:disabled) { filter: brightness(0.95); }
.lg-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Checkbox (uses existing .check-box span) ---------- */
.lg-check { position: relative; }

.lg-check input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lg-check .check-box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: color-mix(in oklch, var(--bg) 60%, transparent);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.lg-check:hover .check-box {
  border-color: var(--gold);
  background: color-mix(in oklch, var(--gold) 12%, var(--surface));
  box-shadow: 0 0 6px color-mix(in oklch, var(--gold) 25%, transparent);
}

.lg-check input:checked + .check-box {
  background: var(--gold);
  border-color: var(--gold);
}

.lg-check input:checked + .check-box svg {
  stroke: var(--bg);
  opacity: 1;
}

/* ---------- Error shake (one-shot) ---------- */
.field-err {
  animation: lg-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes lg-shake {
  10%, 90%   { transform: translateX(-1px); }
  20%, 80%   { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60%   { transform: translateX(4px); }
}

/* ---------- Entrance (one-shot) ---------- */
.lg-fade-in { animation: lg-fade-in 0.4s ease both; }
.lg-fade-up { animation: lg-fade-up 0.4s ease both; }
.lg-delay-1 { animation-delay: 0.08s; }
.lg-delay-2 { animation-delay: 0.16s; }
.lg-delay-3 { animation-delay: 0.24s; }

@keyframes lg-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lg-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Tab switch (one-shot) ---------- */
.lg-tab-in {
  animation: lg-fade-up 0.3s ease both;
}

/* ---------- Spinner (additive to .spinner) ---------- */
.lg-spinner {
  border-top-color: var(--gold);
  border-right-color: var(--patina);
}

/* ---------- Success (one-shot) ---------- */
.lg-success {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in oklch, var(--gold) 12%, transparent);
  animation: lg-success-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.lg-success::after {
  content: '';
  width: 20px;
  height: 10px;
  border: solid var(--gold);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

@keyframes lg-success-pop {
  0%   { opacity: 0; transform: scale(0.5); }
  70%  { opacity: 1; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

/* ---------- Reduced motion: kill motion, keep function ---------- */
@media (prefers-reduced-motion: reduce) {
  .lg-panel, .lg-fade-in, .lg-fade-up, .lg-tab-in, .lg-success { animation: none !important; }
  .field-err { animation: none !important; }
}

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .lg-panel { padding: 0.7rem 1rem 0.85rem; }
  .lg-orb-1 { width: 240px; height: 240px; top: -90px; left: -70px; opacity: 0.2; }
  .lg-orb-2 { width: 220px; height: 220px; bottom: -100px; right: -80px; opacity: 0.18; }
  .lg-grid { background-size: 40px 40px; opacity: 0.35; }
}
