@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&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;
  line-height: 1.35;
  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);
}

.login-card .input-group:focus-within .input-group-text,
.login-card .input-group:focus-within .form-control,
.login-card .input-group:focus-within .btn-password-toggle {
  border-color: #8da0e0;
}

.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;
  min-height: 3.35rem;
  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, opacity 0.18s ease;
}

.btn-login-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 1.4rem;
  min-width: 10.5rem;
}

.btn-login-text {
  white-space: nowrap;
}

.login-spinner {
  display: none;
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: loginSpin 0.65s linear infinite;
}

.btn-login.is-loading .login-spinner {
  display: inline-block;
}

.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);
}

.btn-login:focus-visible {
  outline: 3px solid var(--third);
  outline-offset: 3px;
}

.btn-login:disabled,
.btn-login.is-loading,
.btn-login:disabled:hover,
.btn-login:disabled:focus,
.btn-login.is-loading:hover,
.btn-login.is-loading:focus {
  color: #ffffff;
  opacity: 0.88;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: 0 10px 20px rgba(50, 65, 140, 0.3);
}

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

.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;
  }
}

/* Login page layout corrections — scoped so register stays unchanged */
body.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  color: #ffffff;
  background-color: #1c2d78;
  background-image:
    linear-gradient(165deg, rgba(16, 28, 86, 0.78) 0%, rgba(36, 58, 148, 0.58) 46%, rgba(14, 24, 72, 0.8) 100%),
    url("/img/nulipa_front.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-page .top-header {
  display: none;
}

.login-page .page-content {
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  padding: 1.25rem 1rem;
}

.login-page .login-card {
  padding: 2.25rem 2rem 2.1rem;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.14) 100%),
    rgba(12, 24, 72, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 22px 48px rgba(8, 16, 48, 0.34);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.login-page .login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.login-page .login-card::after {
  content: none;
  display: none;
}

.login-page .login-card-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}

.login-page .brand-area {
  margin-bottom: 1.15rem;
}

.login-page .brand-logo {
  display: block;
  max-width: 168px;
  margin: 0 auto 0.55rem;
  isolation: isolate;
  mix-blend-mode: normal;
  color-interpolation: sRGB;
}

.login-page .brand-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
}

.login-page .login-heading-rule {
  display: block;
  width: 4.25rem;
  height: 1px;
  margin: 0.75rem auto 0.7rem;
  background: rgba(255, 255, 255, 0.85);
}

.login-page h1.login-heading {
  margin: 0;
  padding: 0;
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.login-page .login-heading-admin {
  font-weight: 700;
  color: #ffffff;
}

.login-page .login-field {
  margin-bottom: 0.7rem;
}

.login-page .input-group {
  border-radius: 10px;
  overflow: hidden;
}

.login-page .input-group-text {
  width: 2.55rem;
  min-width: 2.55rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #243274;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.7);
}

.login-page .form-control {
  padding: 0.68rem 0.85rem;
  font-size: 0.95rem;
  color: #1a2347;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.7);
}

.login-page .form-control::placeholder {
  color: #3e4a6e;
  opacity: 1;
  font-size: 0.95rem;
}

.login-page .form-control:focus {
  color: #1a2347;
  background: #ffffff;
  border-color: #8da0e0;
  box-shadow: none;
}

.login-page .btn-password-toggle {
  min-width: 2.6rem;
  padding: 0 0.55rem;
  color: #243274;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.7);
}

.login-page .btn-password-toggle:hover,
.login-page .btn-password-toggle:focus {
  color: #1a2347;
  background: #ffffff;
}

.login-page .login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.75rem;
  width: 100%;
  margin: 0.15rem 0 1.05rem;
}

.login-page .login-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.login-page .login-remember-input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.login-page .login-remember-input:checked {
  background-color: var(--secondary);
  border-color: var(--secondary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.login-page .login-remember-input:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.22);
}

.login-page a.forgot-password-link {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.login-page a.forgot-password-link:hover,
.login-page a.forgot-password-link:focus {
  color: #ffffff;
  background: none;
  text-decoration: underline;
}

.login-page a.forgot-password-link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
  border-radius: 3px;
}

.login-page .forgot-password-help {
  margin: -0.35rem 0 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.85rem;
  line-height: 1.45;
}

.login-page .forgot-password-help:focus {
  outline: none;
}

.login-page .btn-login {
  min-height: 3.1rem;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
  background: linear-gradient(135deg, #3d56c8 0%, #5470e0 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 24px rgba(6, 12, 40, 0.4);
}

.login-page .btn-login:hover,
.login-page .btn-login:focus {
  background: linear-gradient(135deg, #3148b4 0%, #4562d4 100%);
  filter: none;
}

.login-page .alert {
  border: 0;
  border-radius: 10px;
  font-size: 0.85rem;
}

.login-page .btn-login-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 10.25rem;
}

.login-page .login-spinner {
  display: none;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: loginSpin 0.65s linear infinite;
}

.login-page .btn-login.is-loading .login-spinner {
  display: inline-block;
}

@media (max-width: 576px) {
  .login-page .page-content {
    padding: 0.85rem 0.85rem;
  }

  .login-page .login-card {
    padding: 1.5rem 1.15rem 1.35rem;
  }

  .login-page .brand-logo {
    max-width: 148px;
  }

  .login-page .brand-subtitle {
    font-size: 0.86rem;
  }

  .login-page h1.login-heading {
    font-size: 1.02rem;
    white-space: normal;
  }

  .login-page .login-options {
    gap: 0.5rem 0.75rem;
  }
}

@media (max-height: 740px) {
  .login-page .page-content {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .login-page .login-card {
    padding-top: 1.35rem;
    padding-bottom: 1.2rem;
  }

  .login-page .brand-area {
    margin-bottom: 0.8rem;
  }

  .login-page .login-heading-rule {
    margin-top: 0.55rem;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 380px) {
  .login-page .login-options {
    flex-wrap: wrap;
  }

  .login-page a.forgot-password-link {
    margin-left: 0;
  }
}

body.login-page.privacy-page {
  color: #1a2347;
  background-color: #101a44;
  background-image:
    linear-gradient(180deg, rgba(8, 14, 40, 0.86) 0%, rgba(14, 24, 68, 0.8) 100%),
    url("/img/nulipa_front.jpg");
}

.privacy-page .page-content {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 1.5rem 1rem;
  overflow-x: hidden;
}

.privacy-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: min(800px, 100%);
  max-width: 800px;
  margin-top: auto;
  margin-bottom: auto;
  margin-left: auto;
  margin-right: auto;
  max-height: calc(100vh - 3rem);
  max-height: calc(100dvh - 3rem);
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  color: #1a2347;
  box-shadow: 0 18px 42px rgba(8, 16, 48, 0.32);
}

.privacy-header {
  flex: 0 0 auto;
  padding: 1.25rem 1.75rem 1.05rem;
  text-align: center;
  background: linear-gradient(180deg, #243274 0%, #1c2b6e 100%);
  border-bottom: 4px solid #fbd117;
}

.privacy-logo {
  display: block;
  width: 150px;
  max-width: 42%;
  height: auto;
  margin: 0 auto 0.3rem;
}

.privacy-tagline {
  margin: 0 0 0.55rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.privacy-title {
  margin: 0;
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

.privacy-act {
  margin: 0.28rem 0 0;
  color: #fbd117;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
}

.privacy-notice {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 1.35rem 1.6rem 1.45rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: #ffffff;
  color: #1a2347;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: rgba(50, 65, 140, 0.45) transparent;
}

.privacy-notice::-webkit-scrollbar {
  width: 8px;
}

.privacy-notice::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(50, 65, 140, 0.4);
}

.privacy-notice::-webkit-scrollbar-track {
  background: transparent;
}

.privacy-notice:focus-visible {
  outline: 2px solid #32418c;
  outline-offset: -2px;
}

.privacy-notice h2 {
  margin: 1.2rem 0 0.4rem;
  color: #243274;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.privacy-notice p {
  margin: 0 0 0.9rem;
  font-weight: 400;
}

.privacy-notice p:last-child {
  margin-bottom: 0;
}

.privacy-footer {
  flex: 0 0 auto;
  margin: 0;
  padding: 1rem 1.6rem 1.05rem;
  border-top: 1px solid #e3e8f4;
  background: #f7f8fc;
}

.privacy-footer .alert {
  margin-bottom: 0.85rem;
  border: 0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 400;
}

.privacy-agree {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 0.95rem;
  padding: 0.15rem 0;
  color: #1a2347;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.privacy-agree .login-remember-input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.3rem;
  height: 1.3rem;
  margin: 0.12rem 0 0;
  flex-shrink: 0;
  border: 2px solid #32418c;
  border-radius: 0.28rem;
  background: #ffffff;
  cursor: pointer;
}

.privacy-agree .login-remember-input:checked {
  background-color: #32418c;
  border-color: #32418c;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.privacy-agree .login-remember-input:focus-visible {
  outline: 2px solid #fbd117;
  outline-offset: 2px;
}

.privacy-continue {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 10px;
  background: #32418c;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(50, 65, 140, 0.22);
}

.privacy-continue:hover,
.privacy-continue:focus {
  background: #1f2d70;
}

.privacy-continue:focus-visible {
  outline: 3px solid #fbd117;
  outline-offset: 3px;
}

.privacy-continue:disabled,
.privacy-continue:disabled:hover,
.privacy-continue:disabled:focus {
  background: #e6eaf4;
  color: #2a3458;
  cursor: not-allowed;
  box-shadow: none;
  outline: none;
}

.privacy-page .page-content a.privacy-back {
  display: block;
  width: fit-content;
  margin: 0.8rem auto 0;
  color: #4a5678;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.privacy-back:hover {
  color: #243274;
  text-decoration: underline;
}

.privacy-back:focus-visible {
  outline: 2px solid #32418c;
  outline-offset: 3px;
  border-radius: 3px;
}

@media (max-width: 700px) {
  .privacy-page .page-content {
    align-items: flex-start;
    padding: 0.75rem;
  }

  .privacy-card {
    max-height: none;
    border-radius: 14px;
  }

  .privacy-header {
    padding: 1rem 1rem 0.9rem;
  }

  .privacy-title {
    font-size: 1.25rem;
  }

  .privacy-tagline {
    font-size: 0.68rem;
  }

  .privacy-notice {
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: 1rem 1rem 1.1rem;
    font-size: 0.98rem;
  }

  .privacy-footer {
    padding: 0.9rem 1rem 0.95rem;
  }
}