:root {
  --white: #ffffff;
  --overlay: #8c4545b8;
  --brand-red: #d53b0b;
  --input-border: #0e9aa7;
  --input-active: #c8340f;
  --text-body: #3b3b3b;
  --text-muted: #959595;
  --placeholder: #c5c5c5;
  --checkbox-border: #a7a7a7;
  --checkbox-tick: #8e8e8e;
  --button-disabled: #8b8b8b;
  --button-active: #d53b0b;
  --card-bg: rgba(255, 255, 255, 0.97);
  --card-radius: 32px;
  --input-radius: 14px;
  --button-radius: 20px;
  --active-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html,
body {
  min-height: 100%;
}

html {
  font-size: 16px;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--white);
  background: #5a2e2e;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

a {
  text-decoration: none;
}

.login-page {
  position: relative;
  min-height: 100vh;
  background: url("../assets/background.png") center center / cover no-repeat;
  overflow: hidden;
}

.background-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.login-hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 24px;
}

.brand {
  margin-bottom: 18px;
}

.brand__logo {
  width: 108px;
  height: auto;
}

.hero-copy {
  margin-bottom: 24px;
  text-align: center;
}

.hero-copy h1 {
  font-size: 3rem;
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--white);
}

.login-card {
  width: 860px;
  max-width: calc(100vw - 120px);
  min-height: 470px;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 92px 44px;
  transition: transform 0.35s var(--ease-soft), box-shadow 0.35s var(--ease-soft);
}

.login-card__inner {
  width: 100%;
  max-width: 620px;
}

.login-card__header {
  text-align: center;
  margin-bottom: 34px;
}

.login-card__header h2 {
  font-size: 2.6rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--brand-red);
  margin-bottom: 8px;
}

.login-card__header p {
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 400;
  color: var(--text-muted);
}

.login-form {
  width: 100%;
}

.form-group {
  position: relative;
  margin-bottom: 24px;
}

.form-group input {
  width: 100%;
  height: 64px;
  border: 2px solid var(--input-border);
  border-radius: var(--input-radius);
  background: transparent;
  outline: none;
  padding: 0 20px;
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--text-body);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background-color 0.2s ease;
}

.form-group input::placeholder {
  color: var(--placeholder);
}

.form-group input:hover {
  transform: translateY(-1px);
}

.form-group input:focus {
  border-color: var(--input-active);
  box-shadow: 0 0 0 3px rgba(200, 52, 15, 0.08);
}

.form-group--password input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #bababa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(200, 52, 15, 0.22);
  outline-offset: 2px;
  border-radius: 4px;
}

.eye-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.eye-icon--closed {
  opacity: 0;
  transform: scale(0.95);
}

.password-toggle.is-visible .eye-icon--open {
  opacity: 0;
  transform: scale(0.95);
}

.password-toggle.is-visible .eye-icon--closed {
  opacity: 1;
  transform: scale(1);
}

.login-btn {
  width: 100%;
  height: 58px;
  margin-top: 22px;
  border: none;
  border-radius: var(--button-radius);
  background: var(--button-disabled);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.login-btn.active {
  background: var(--button-active);
  box-shadow: var(--active-shadow);
  cursor: pointer;
}

.login-btn.active:hover {
  transform: translateY(-2px);
}

.login-btn.active:active {
  transform: translateY(0);
}

/* Button Loading States */
.spinner {
  display: none;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

.login-btn.is-loading {
  background: var(--button-active);
  cursor: wait;
  opacity: 0.85;
  transform: none !important; /* Prevents button jump on click */
}

.login-btn.is-loading .btn-text {
  display: none;
}

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

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

.form-footer {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.checkbox-wrap,
.forgot-link {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrap:hover,
.forgot-link:hover {
  transform: translateY(-1px);
}

.checkbox-wrap input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--checkbox-border);
  border-radius: 4px;
  background: #fff;
  position: relative;
  flex-shrink: 0;
}

.checkbox-wrap input:checked + .custom-checkbox::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--checkbox-tick);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-size: 0.95rem;
  line-height: 1.2;
  font-weight: 400;
  color: #909090;
}

.forgot-link {
  font-size: 0.95rem;
  line-height: 1.2;
  font-weight: 600;
  color: var(--brand-red);
}

.forgot-link:hover {
  opacity: 0.85;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand,
.hero-copy,
.login-card,
.login-card__header,
.form-group,
.login-btn,
.form-footer {
  opacity: 0;
  will-change: transform, opacity;
}

body.is-loaded .brand {
  animation: fadeDown 0.7s var(--ease-smooth) forwards;
}

body.is-loaded .hero-copy {
  animation: fadeDown 0.75s var(--ease-smooth) 0.08s forwards;
}

body.is-loaded .login-card {
  animation: cardReveal 0.9s var(--ease-smooth) 0.16s forwards;
}

body.is-loaded .login-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
}

body.is-loaded .login-card__header {
  animation: fadeUp 0.65s var(--ease-soft) 0.34s forwards;
}

body.is-loaded .form-group:nth-of-type(1) {
  animation: fadeUp 0.6s var(--ease-soft) 0.42s forwards;
}

body.is-loaded .form-group:nth-of-type(2) {
  animation: fadeUp 0.6s var(--ease-soft) 0.5s forwards;
}
body.is-loaded .form-group:nth-of-type(3) {
    animation: fadeUp 0.6s var(--ease-soft) 0.51s forwards;
}

body.is-loaded .login-btn {
  animation: fadeUp 0.65s var(--ease-soft) 0.58s forwards;
}

body.is-loaded .form-footer {
  animation: fadeUp 0.65s var(--ease-soft) 0.66s forwards;
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1200px) {
  .login-card {
    width: 100%;
    max-width: calc(100vw - 48px);
    min-height: auto;
    padding: 40px 36px 32px;
  }

  .login-card__inner {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .login-hero {
    padding: 32px 16px 24px;
  }

  .brand {
    margin-bottom: 14px;
  }

  .brand__logo {
    width: 92px;
  }

  .hero-copy {
    margin-bottom: 20px;
  }

  .hero-copy h1 {
    font-size: 2rem;
  }

  .login-card {
    width: 100%;
    max-width: 100%;
    border-radius: 24px;
    padding: 28px 20px;
  }

  .login-card__header {
    margin-bottom: 24px;
  }

  .login-card__header h2 {
    font-size: 2rem;
  }

  .form-group {
    margin-bottom: 18px;
  }

  .form-group input {
    height: 56px;
    padding: 0 16px;
    font-size: 0.95rem;
  }

  .form-group--password input {
    padding-right: 48px;
  }

  .password-toggle {
    right: 14px;
  }

  .login-btn {
    height: 54px;
    margin-top: 14px;
  }

  .form-footer {
    margin-top: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .checkbox-label,
  .forgot-link {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .brand,
  .hero-copy,
  .login-card,
  .login-card__header,
  .form-group,
  .login-btn,
  .form-footer {
    opacity: 1 !important;
    transform: none !important;
  }
}


.feedback-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 20px;
}

    .feedback-modal-overlay.active {
        display: flex;
    }

.feedback-modal {
    background: #fff;
    color: #1A1D2B;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    padding: 35px 25px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.feedback-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 34px;
    font-weight: 700;
}

    .feedback-icon.success {
        background: #2ECC71;
    }

    .feedback-icon.error {
        background: #C8340F;
    }

.feedback-modal h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.feedback-modal p {
    color: #6B7280;
    line-height: 1.6;
    margin-bottom: 25px;
}