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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #2d1a0a;
}

/* ── Full-screen background ── */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
}
.bg-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
/* Warm gradient overlay — darkens bottom, keeps sky visible */
.bg-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(15, 8, 2, 0.10) 0%,
      rgba(15, 8, 2, 0.25) 50%,
      rgba(15, 8, 2, 0.65) 100%
    );
}

/* ── Centered login wrapper ── */
.login-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ── Logo / brand above card ── */
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.login-logo-mark {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 220, 160, 0.40);
  box-shadow: 0 4px 20px rgba(0,0,0,0.45);
}
.login-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.login-logo h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0,0,0,0.4);
}
.login-logo h1 span {
  color: #fcd34d;
}
.login-logo p {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.1px;
}

/* ── Glass card ── */
.login-card {
  width: 100%;
  background: rgba(12, 6, 1, 0.72);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid rgba(255, 220, 160, 0.35);
  border-radius: 22px;
  padding: 40px 36px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.60),
    0 4px 16px rgba(0, 0, 0, 0.40),
    0 1px 0 rgba(255, 200, 100, 0.18) inset;
}

.card-heading {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.card-sub {
  font-size: 13.5px;
  color: rgba(255, 235, 195, 0.65);
  margin-bottom: 26px;
  font-weight: 400;
}

/* Error alert override for glass context */
#error-msg {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}

/* ── Form elements ── */
.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 235, 195, 0.80);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
}
.field input {
  width: 100%;
  height: 46px;
  background: rgba(255, 245, 220, 0.10);
  border: 1px solid rgba(255, 220, 160, 0.22);
  border-radius: 11px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: #fff;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder {
  color: rgba(255, 220, 160, 0.35);
  font-weight: 400;
}
.field input:focus {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(255, 245, 220, 0.16);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
}
/* Autofill override */
.field input:-webkit-autofill,
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px rgba(60, 35, 10, 0.85) inset;
  -webkit-text-fill-color: #fff;
  transition: background-color 5000s ease-in-out 0s;
}

/* ── Submit button ── */
.btn-signin {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border: 1px solid rgba(251, 191, 36, 0.30);
  border-radius: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 4px 16px rgba(180, 83, 9, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-signin:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 6px 24px rgba(180, 83, 9, 0.55);
}
.btn-signin:active:not(:disabled) {
  transform: scale(0.98);
}
.btn-signin:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-signin svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Footer credit ── */
.login-footer {
  font-size: 12px;
  color: rgba(255,255,255,0.30);
  text-align: center;
}

/* ── Fade-in animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-wrapper {
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .login-wrapper { animation: none; }
  .btn-signin, .field input { transition: none; }
}

/* ── Username field header with clear link ── */
.field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}
.clear-username {
  font-size: 11.5px;
  color: rgba(251, 191, 36, 0.65);
  cursor: pointer;
  text-decoration: none;
  transition: color 180ms ease;
}
.clear-username:hover {
  color: rgba(251, 191, 36, 0.95);
}

/* ── Checkbox field ── */
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 18px 0;
}
.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #d97706;
}
.checkbox-field label {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 235, 195, 0.75);
  cursor: pointer;
  flex: 1;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .login-card { padding: 28px 20px; border-radius: 18px; }
  .card-heading { font-size: 20px; }
}
