:root {
  --blue: #0a2472;
  --blue-mid: #1338be;
  --blue-light: #1a4fff;
  --blue-dark: #061440;
  --red: #d62828;
  --red-dark: #a11f1f;
  --red-light: #ff3b3b;
  --white: #ffffff;
  --gray-200: #d8e0f0;
  --gray-400: #8a9bbf;
  --gray-600: #4a5a80;
  --card-bg: #0d1b4b;
  --card-border: #1a2e6e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--blue-dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Background shapes */
.bg-shapes { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .18;
}
.s1 { width: 500px; height: 500px; background: var(--blue-light); top: -150px; left: -100px; }
.s2 { width: 400px; height: 400px; background: var(--red);        bottom: -100px; right: -80px; }
.s3 { width: 300px; height: 300px; background: var(--blue-mid);   top: 40%; left: 55%; }

/* Card */
.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 48px rgba(0,0,0,.55);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: .4rem;
}
.brand-icon { font-size: 2rem; color: var(--red-light); }
.brand-name { font-size: 1.9rem; font-weight: 800; color: var(--white); letter-spacing: .02em; }
.brand-sub { text-align: center; font-size: .85rem; color: var(--gray-400); margin-bottom: 2rem; }

.form-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.25rem;
  text-align: center;
}

/* Fields */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .82rem; color: var(--gray-200); font-weight: 600; }
.field input {
  padding: .65rem .9rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--blue-dark);
  color: var(--white);
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
  width: 100%;
  font-family: inherit;
}
.field input:focus { border-color: var(--blue-light); }

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 2.8rem; }
.toggle-pass {
  position: absolute;
  right: .7rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--gray-400);
  padding: .2rem;
  line-height: 1;
}
.toggle-pass:hover { color: var(--white); }

/* Buttons */
.btn-primary {
  width: 100%;
  padding: .75rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(90deg, var(--blue-light), var(--red));
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: .5rem;
  transition: opacity .15s, transform .1s;
  letter-spacing: .03em;
}
.btn-primary:hover  { opacity: .9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  width: 100%;
  padding: .6rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--gray-400);
  font-size: .88rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: background .15s, color .15s;
}
.btn-secondary:hover { background: var(--blue-dark); color: var(--white); }

/* Error */
.error-msg {
  background: rgba(214, 40, 40, .15);
  border: 1px solid var(--red);
  color: #ff8080;
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .85rem;
  margin-bottom: 1rem;
}

/* Avatar grid */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .85rem;
  margin-bottom: .5rem;
}
.avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1rem .5rem;
  border-radius: 14px;
  border: 2px solid var(--card-border);
  background: var(--blue-dark);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.avatar-card:hover { border-color: var(--blue-light); background: var(--blue); transform: translateY(-2px); }
.avatar-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
}
.avatar-name { font-size: .82rem; font-weight: 600; color: var(--gray-200); text-align: center; word-break: break-word; }
