/* css/style.css */

:root {
  --bg: #000000;
  --surface: rgba(11, 11, 13, 0.72);
  --surface-2: rgba(19, 19, 22, 0.72);
  --surface-solid: #131316;
  --border: #1f1f23;
  --border-hi: #2e2e34;
  --text: #ffffff;
  --text-soft: #8a8a92;
  --text-mute: #55555c;
  --accent: #ffffff;
  --danger: #ff4d6d;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: #000;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 50% -10%, rgba(120, 140, 255, 0.10), transparent 45%),
    radial-gradient(circle at 50% 110%, rgba(180, 140, 255, 0.08), transparent 40%),
    #000;
}

a { color: inherit; text-decoration: none; }

/* ============ STARFIELD CANVAS ============ */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* ============ PAGE ============ */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 32px;
  gap: 20px;
}

/* ============ BRAND ============ */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -32px;
  margin-bottom: 4px;
  animation: fadeDown 0.5s ease both;
}

.brand-logo {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  display: block;
  object-fit: cover;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ CARD ============ */
.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  animation: fadeUp 0.55s ease both;
  animation-delay: 0.05s;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 26px;
}

/* ============ FORM ============ */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  padding-left: 2px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-link {
  font-size: 12.5px;
  color: var(--text-soft);
  transition: color .15s ease;
}

.field-link:hover { color: var(--text); }

.field-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 14px;
  height: 48px;
  transition: border-color .18s ease, background .18s ease;
}

.field-input:focus-within {
  border-color: var(--border-hi);
  background: var(--surface-solid);
}

.field-input.is-error {
  border-color: var(--danger);
  background: rgba(255, 77, 109, 0.06);
}

.field-icon {
  width: 18px;
  height: 18px;
  color: var(--text-mute);
  flex-shrink: 0;
  transition: color .18s ease;
}

.field-input:focus-within .field-icon { color: var(--text); }
.field-input.is-error .field-icon { color: var(--danger); }

.field-input input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 0;
}

.field-input input::placeholder { color: var(--text-mute); }

.field-input input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px var(--surface-solid) inset;
  -webkit-text-fill-color: #fff;
}

.toggle-pass {
  background: none;
  border: none;
  padding: 4px;
  color: var(--text-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}

.toggle-pass:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.toggle-pass svg { width: 17px; height: 17px; }

.toggle-pass.is-visible {
  color: var(--text);
}

/* ============ CHECKBOX ============ */
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-hi);
  background: var(--surface-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s ease;
}

.checkbox-box svg {
  width: 12px;
  height: 12px;
  color: #000;
  opacity: 0;
  transform: scale(0.6);
  transition: all .15s ease;
}

.checkbox input:checked + .checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox input:checked + .checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}

.checkbox-text {
  font-size: 13.5px;
  color: var(--text-soft);
}

/* ============ SUBMIT ============ */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: none;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #000;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, opacity .15s ease, box-shadow .2s ease;
}

.btn-submit svg { width: 17px; height: 17px; }

.btn-submit:hover:not(:disabled) {
  opacity: 0.9;
  box-shadow: 0 0 24px rgba(255,255,255,0.22);
}

.btn-submit:active:not(:disabled) { transform: translateY(1px); }

.btn-submit:disabled {
  cursor: wait;
  opacity: 0.85;
}

.btn-submit.is-loading svg {
  animation: spin 0.8s linear infinite;
  width: 17px;
  height: 17px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ DIVIDER ============ */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
}

.divider span {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--text-mute);
}

/* ============ PROVIDERS ============ */
.providers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.provider {
  height: 48px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
}

.provider:hover {
  border-color: var(--border-hi);
  background: var(--surface-solid);
  transform: translateY(-1px);
}

.provider:active { transform: translateY(0); }

.provider svg { width: 20px; height: 20px; }

/* ============ SWITCH ============ */
.switch {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-soft);
  margin-top: 24px;
}

.switch a {
  color: var(--text);
  font-weight: 600;
}

.switch a:hover {
  text-decoration: underline;
}

/* ============ FOOTER ============ */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-mute);
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.15s;
}

.foot a { transition: color .15s ease; }
.foot a:hover { color: var(--text-soft); }
.foot-copy { color: var(--text-mute); }

/* ============ SHAKE ============ */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.form.shake {
  animation: shake 0.4s ease;
}

/* ============ MOBILE ============ */
@media (max-width: 480px) {
  .page { padding: 16px 16px 28px; gap: 16px; }
  .brand { margin-top: -12px; }
  .brand-logo { width: 78px; height: 78px; border-radius: 20px; }
  .card { padding: 26px 20px; border-radius: 18px; }
  .card-title { font-size: 22px; }
}

/* ============ ERROR PAGES (404 / 503) ============ */
.error-page {
  justify-content: center;
}

.brand-link {
  display: block;
  transition: transform .2s ease;
}

.brand-link:hover {
  transform: scale(1.04);
}

.error-card {
  text-align: center;
  padding: 40px 32px;
}

.error-code {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #55555c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.error-card .card-title {
  font-size: 22px;
  margin-bottom: 10px;
}

.error-card .card-subtitle {
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.6;
}

.error-card .btn-submit {
  text-decoration: none;
  display: flex;
}

@media (max-width: 480px) {
  .error-code { font-size: 56px; }
  .error-card { padding: 32px 22px; }
}