@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

:root {
  --primary: #FDFAF6;
  --secondary: #32418C;
  --secondary-deep: #1f2d70;
  --secondary-soft: #5f74ca;
  --third: #FBD117;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 10%, rgba(50, 65, 140, 0.14) 0%, rgba(50, 65, 140, 0) 36%),
    radial-gradient(circle at 84% 18%, rgba(251, 209, 23, 0.16) 0%, rgba(251, 209, 23, 0) 40%),
    linear-gradient(180deg, #fffdf9 0%, #f6f8ff 100%);
  font-family: "Poppins", sans-serif;
  color: var(--secondary);
  overflow: hidden;
}

.top-header {
  height: 60px;
  background: linear-gradient(90deg, var(--secondary-deep) 0%, var(--secondary) 54%, var(--secondary-soft) 100%);
  border-bottom: 6px solid var(--third);
  box-shadow: 0 8px 18px rgba(24, 34, 92, 0.22);
}

/* Center everything vertically & horizontally */
.page-content {
  min-height: calc(100vh - 86px);   /* header height + border */
  height: calc(100vh - 66px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.brand-area {
  margin-bottom: 1.5rem;
}

.brand-logo {
  max-width: 180px;
  height: auto;
}

.brand-subtitle {
  color: var(--secondary);
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}

.login-card {
  position: relative;
  background: linear-gradient(165deg, #ffffff 0%, #f4f7ff 100%);
  border: 1px solid #d9e0f4;
  border-radius: 16px;
  box-shadow: 0 20px 34px rgba(25, 36, 92, 0.18);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 600px;
  animation: cardRiseIn 0.5s ease both;
}

.login-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 209, 23, 0.32) 0%, rgba(251, 209, 23, 0) 70%);
  pointer-events: none;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 2rem;
}

.input-group-text {
  background: linear-gradient(180deg, #ffd84f 0%, #f3be13 100%);
  border-right: none;
  border-color: #e9d99d;
  font-size: 1.2rem;
  color: var(--primary);
}

.form-control {
  border-left: none;
  border-color: #d6def1;
  background: #fbfcff;
  font-size: 1rem;
  padding: 0.75rem 1rem;
}

.form-control::placeholder {
  color: var(--secondary);
  opacity: 0.5;
  font-size: 1rem;
}

.form-control:focus {
  border-color: #8da0e0;
  box-shadow: 0 0 0 0.25rem rgba(80, 101, 184, 0.22);
}

.btn-password-toggle {
  background: #fbfcff;
  border: 1px solid #d6def1;
  border-left: none;
  color: var(--secondary);
  min-width: 3.2rem;
}

.btn-password-toggle:hover,
.btn-password-toggle:focus {
  background: #f2f6ff;
  color: var(--secondary-deep);
}

.btn-password-toggle:focus {
  box-shadow: 0 0 0 0.25rem rgba(80, 101, 184, 0.22);
}

.email-warning {
  display: none;
  color: #d9534f;
  font-size: 0.88rem;
  margin: 0.4rem 0 0;
}

.email-warning.show {
  display: block;
}

.confirm-password-warning {
  display: none;
  color: #d9534f;
  font-size: 0.88rem;
  margin: 0.4rem 0 0;
}

.confirm-password-warning.show {
  display: block;
}

.register-step-indicator {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secondary);
  opacity: 0.8;
  text-align: right;
}

.register-step-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.password-helper {
  display: none;
  margin-top: 0.75rem;
}

.password-helper.show {
  display: block;
}

.password-strength {
  width: 100%;
  height: 8px;
  background: #e5e5e5;
  border-radius: 999px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.password-strength-bar.weak {
  background: #d9534f;
}

.password-strength-bar.fair {
  background: #f0ad4e;
}

.password-strength-bar.good {
  background: #5bc0de;
}

.password-strength-bar.strong {
  background: #5cb85c;
}

.password-strength-text {
  color: var(--secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.password-rules {
  list-style: none;
  padding-left: 0;
}

.password-rules li {
  position: relative;
  color: var(--secondary);
  opacity: 0.75;
  padding-left: 1.3rem;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

.password-rules li::before {
  content: "\25CB";
  position: absolute;
  left: 0;
  top: 0;
}

.password-rules li.passed {
  opacity: 1;
}

.password-rules li.passed::before {
  content: "\2713";
  color: #2e7d32;
}

.password-valid-indicator {
  display: none;
  background-color: var(--primary);
  border-left: none;
  color: #2e7d32;
  font-size: 1.2rem;
  min-width: 2.75rem;
  justify-content: center;
  align-items: center;
}

.password-valid-indicator.show {
  display: flex;
}

.btn-login {
  background: linear-gradient(135deg, var(--secondary) 0%, #5166bd 100%);
  border: 0;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.85rem;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(50, 65, 140, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-login:hover,
.btn-login:focus {
  color: #ffffff;
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 14px 24px rgba(50, 65, 140, 0.36);
}

.page-content a {
  color: var(--secondary);
  font-weight: 700;
  text-decoration: none;
}

.page-content a:hover {
  text-decoration: underline;
}

@keyframes cardRiseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive tweaks */
@media (max-width: 576px) {
  body {
    overflow: auto;
  }

  .page-content {
    height: auto;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }
  .brand-logo {
    max-width: 240px;
  }
}