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

:root {
  --login-purple: #6B34C4;
  --login-purple-dark: #4f2494;
  --login-yellow: #FFD335;
  --login-ink: #1f1236;
}

body.login-page {
  --title-font-family: var(--display-font-family, 'Poppins', 'Inter', sans-serif);
  --body-font-family: 'Inter', sans-serif;
  background: linear-gradient(140deg, #ffe98a 0%, #ffd335 55%, #ffcb2c 100%);
  color: #2c1b4a;
  font-family: var(--body-font-family);
}

.login-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 16px;
}

.login-hero .container {
  transform: none;
}

.login-form-wrap {
  width: min(430px, 88vw);
  display: grid;
  gap: 16px;
  background: rgba(255, 255, 255, 0.68);
  border-radius: 32px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.09);
  padding: 24px 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: loginCardIn 0.5s ease;
}

.login-heading {
  font-family: var(--title-font-family);
  font-size: clamp(34px, 4.5vw, 42px);
  font-weight: 900;
  text-align: center;
  color: #2c1b4a;
}

.login-form {
  display: grid;
  gap: 20px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #ff3b30;
  line-height: 1.4;
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  transition: opacity 0.2s ease, max-height 0.2s ease, margin-top 0.2s ease;
}

.login-error.show {
  opacity: 1;
  max-height: 48px;
  margin-top: 6px;
}

.login-field label {
  font-weight: 700;
  font-size: 15px;
  color: #2c1b4a;
}

.login-field input[type="text"],
.login-field input[type="email"],
.login-field input[type="password"] {
  border: 2px solid #6B34C4;
  border-radius: 22px;
  padding: 16px 20px;
  font-size: 16px;
  background: #e9eeff;
  color: #1b1b1b;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-field input:focus {
  outline: none;
  border-color: #4f2494;
  box-shadow: 0 0 0 4px rgba(107, 52, 196, 0.22);
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap input {
  width: 100%;
  padding-right: 56px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #6B34C4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.password-toggle i {
  font-size: 18px;
}

.password-toggle:hover {
  background: rgba(107, 52, 196, 0.12);
  transform: translateY(-50%) scale(1.02);
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(107, 52, 196, 0.22);
}

.login-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #2c1b4a;
}

.login-remember input {
  position: relative;
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #6B34C4;
  border-radius: 10px;
  background: #e9eeff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px rgba(107, 52, 196, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.login-remember input:checked {
  background: #6B34C4;
  border-color: #6B34C4;
  box-shadow: 0 0 0 3px rgba(107, 52, 196, 0.2);
  transform: translateY(-1px);
}

.login-remember input:checked::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 5px;
  border: 2px solid #ffffff;
  border-right: 0;
  border-top: 0;
  transform: translate(0px, 0px) rotate(-45deg);
}

.login-link {
  font-weight: 800;
  color: #2c1b4a;
  text-decoration: none;
}

.login-forgot-toggle {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.login-forgot-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(107, 52, 196, 0.2);
  background: rgba(255, 255, 255, 0.5);
}

.login-forgot-note {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #2c1b4a;
}

.login-forgot-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.login-forgot-panel input[type="email"] {
  border: 2px solid #6B34C4;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 15px;
  background: #e9eeff;
  color: #1b1b1b;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-forgot-panel input[type="email"]:focus {
  outline: none;
  border-color: #4f2494;
  box-shadow: 0 0 0 4px rgba(107, 52, 196, 0.22);
}

.login-forgot-btn {
  border-radius: 16px;
  border: 0;
  background: #6B34C4;
  color: #ffffff;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.login-forgot-btn:hover {
  background: #4f2494;
  box-shadow: 0 8px 16px rgba(79, 36, 148, 0.2);
}

.login-forgot-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.login-link:hover {
  color: #1a0f33;
}

.login-link .link-word {
  text-decoration: underline;
}

.login-actions {
  display: grid;
  gap: 22px;
  margin-top: 10px;
  grid-template-columns: 1fr;
  justify-items: stretch;
}

.login-actions > * {
  width: 100%;
}

.btn-primary-login,
.btn-ghost-login,
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 800;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.btn-primary-login {
  background: var(--login-yellow);
  color: #262626;
  border: 3px solid #2c1b4a;
  font-size: 17px;
}

.btn-primary-login:hover {
  background: #ffe26a;
}

.btn-primary-login:active {
  transform: translateY(1px);
}

.btn-ghost-login {
  background: transparent;
  color: #2c1b4a;
  border-color: #2c1b4a;
}

.btn-ghost-login:hover {
  border-color: #1a0f33;
  color: #1a0f33;
}

/* Google button overrides (white fill) */
.btn-ghost-login.btn-google {
  background: #ffffff;
  color: #2c1b4a;
  border-color: #ffffff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.09);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-ghost-login.btn-google::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background: url('https://www.gstatic.com/images/branding/googleg/1x/googleg_standard_color_128dp.png') center/contain no-repeat;
}

.btn-ghost-login.btn-google:hover {
  border-color: #d1d5db;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.login-actions a.btn-ghost-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
}

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