/* Login / register screen */

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-shell {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px 28px;
  box-shadow: var(--shadow), var(--shadow-gold);
  position: relative;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.auth-logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(212, 175, 55, 0.25));
}

.auth-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 22px;
  background: rgba(0, 0, 0, 0.3);
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 200ms ease, background 200ms ease;
}
.auth-tab.active {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.auth-form {
  display: none;
  flex-direction: column;
}
.auth-form.active { display: flex; }

.auth-form input {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 200ms ease;
}
.auth-form input:focus { border-color: var(--gold); }

.auth-form .opt {
  color: var(--muted);
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}

.auth-submit {
  margin-top: 22px;
  width: 100%;
  padding: 13px 16px;
  font-size: 12px;
}

.auth-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: #d97565;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-align: center;
}

.auth-foot {
  margin: 24px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Topbar user chip (used on dashboard / internal pages) */
.logout-link {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease;
}
.logout-link:hover { color: var(--gold); border-color: var(--border-strong); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon-only buttons for mobile */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
  flex-shrink: 0;
}
.icon-btn:hover, .icon-btn:active {
  color: var(--gold);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}
.icon-btn svg { width: 18px; height: 18px; }

/* =====================================================================
   MOBILE — auth screen
   ===================================================================== */

@media (max-width: 768px) {
  .auth-body {
    padding: 0;
    align-items: stretch;
    /* leave room for the home indicator on iOS */
    padding-bottom: env(safe-area-inset-bottom);
  }
  .auth-shell {
    max-width: 100%;
    display: flex;
    align-items: center;
    min-height: 100dvh;
    padding: 20px 16px;
    padding-top: max(20px, env(safe-area-inset-top));
  }
  .auth-card {
    width: 100%;
    padding: 32px 22px 24px;
    border-radius: 16px;
  }
  .auth-logo { margin-bottom: 22px; }
  .auth-logo img { width: 64px; height: 64px; }

  .auth-tabs { margin-bottom: 18px; }
  .auth-tab { padding: 13px 10px; font-size: 11px; }

  /* iOS won't zoom-on-focus if input font-size >= 16px */
  .auth-form input {
    font-size: 16px;
    padding: 14px 14px;
    min-height: 48px;
  }
  .auth-form .field-label { font-size: 10.5px; }

  .auth-submit {
    margin-top: 22px;
    min-height: 50px;
    font-size: 13px;
    padding: 14px 16px;
  }

  .auth-foot {
    margin-top: 20px;
    font-size: 9.5px;
    line-height: 1.5;
  }

  .logout-link {
    padding: 8px 12px;
    font-size: 10.5px;
    min-height: 36px;
  }
}

/* Smaller phones */
@media (max-width: 380px) {
  .auth-card { padding: 26px 18px 22px; }
  .auth-logo img { width: 56px; height: 56px; }
}
