* {
  box-sizing: border-box;
}
:root {
  --bg: #050819;
  --card: rgba(9, 17, 41, 0.72);
  --card-border: rgba(126, 170, 255, 0.22);
  --text: #e8f1ff;
  --muted: #a7b1cc;
  --accent1: #7c4dff;
  --accent2: #03d8ff;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, rgba(0, 181, 255, 0.12), transparent 45%),
              radial-gradient(circle at 80% 25%, rgba(125, 60, 255, 0.15), transparent 38%),
              linear-gradient(170deg, #020713 0%, #040c1f 56%, #041041 100%);
  overflow-x: hidden;
}
.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.background {
  position: fixed;
  inset: 0;
  background: url('assets/images/backgrounds/nebula.png') center/cover no-repeat;
  opacity: .32;
  filter: blur(1.8px);
  z-index: 0;
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(430px, 90vw);
  padding: 2rem;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  background: var(--card);
  animation: pop 0.5s ease backwards;
}
@keyframes pop {
  from { transform: translateY(30px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.brand {
  text-align: center;
  margin-bottom: 1.1rem;
}
.brand img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 0 12px rgba(67, 220, 255, 0.6));
}
.brand h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
}
.subtext {
  margin: 0 0 1.4rem;
  color: var(--muted);
  text-align: center;
}
.login-form {
  display: grid;
  gap: 0.75rem;
}
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}
.mode-btn {
  background: rgba(9, 19, 49, 0.6);
  color: #8aa7d5;
  border: 1px solid rgba(132, 155, 192, 0.24);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  font-weight: 600;
  cursor: pointer;
}
.mode-btn.active {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #fff;
  border-color: rgba(3, 216, 255, 0.5);
}

.input-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 500;
}
.input-wrap {
  position: relative;
}
.input-wrap input {
  width: 100%;
  border: 1px solid rgba(160, 182, 242, 0.24);
  background: rgba(13, 24, 55, 0.62);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  color: #eef5ff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-wrap input:focus {
  border-color: rgba(3, 216, 255, 0.86);
  box-shadow: 0 0 0 3px rgba(73, 180, 255, 0.2);
}
.password-wrap {
  display: flex;
  align-items: center;
}
.password-wrap input {
  padding-right: 3rem;
}
.toggle-password {
  position: absolute;
  right: 0.65rem;
  border: none;
  background: transparent;
  color: #a5b8ed;
  font-size: 0.95rem;
  cursor: pointer;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 0.3rem;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.2rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: #a7b1cc;
}
.checkbox-label input {
  width: 16px;
  height: 16px;
  accent-color: #03d8ff;
}
.link {
  font-size: 0.88rem;
  color: #7ec9ff;
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}
.btn {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 0.85rem 1rem;
  width: 100%;
  font-weight: 700;
  font-size: 1rem;
}
.btn-primary {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #fff;
  box-shadow: 0 10px 20px rgba(10, 72, 139, 0.4);
}
.btn-primary:hover {
  filter: brightness(1.05);
}
.divider {
  margin: 1.05rem 0 0.85rem;
  text-align: center;
  color: var(--muted);
  position: relative;
}
.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: rgba(167, 177, 204, 0.35);
}
.divider::before { left: 0; }
.divider::after { right: 0; }
.divider span {
  display: inline-block;
  padding: 0 0.7rem;
  background: linear-gradient(170deg, rgba(5, 8, 25, 0.9), rgba(4, 10, 33, 0.9));
}
.bottom {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}
.bottom a {
  color: #f7fbff;
  font-weight: 700;
  text-decoration: none;
}
.bottom a:hover {
  text-decoration: underline;
}
@media (max-width: 460px) {
  .login-card { padding: 1.3rem; }
  .brand h1 { font-size: 1.4rem; }
  .button { font-size: 0.95rem; }
}

@media (max-width: 360px) {
  .login-card { padding: 1rem; }
  .brand h1 { font-size: 1.2rem; }
  .input-wrap input { padding: 0.75rem 0.8rem; font-size: 0.88rem; }
  .btn { padding: 0.75rem; font-size: 0.92rem; }
}

@media (min-width: 600px) {
  .login-card { padding: 2.5rem; }
  .brand h1 { font-size: 1.9rem; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .page { padding: 0.5rem; align-items: flex-start; }
  .login-card { padding: 1rem 1.5rem; }
  .brand { margin-bottom: 0.6rem; }
  .brand img { width: 40px; height: 40px; }
}
