*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 8rem 8rem 6rem;
  background: linear-gradient(135deg, rgba(11,35,24,0.68) 0%, rgba(11,35,24,0.53) 50%),
    url('/assets/img/LOGIN_BG.png') center center / cover no-repeat;
  padding: 24px 16px;
}

/* ── Card ──────────────────────────────────────────────────── */
.auth-card {
  background:  #ffffff;
  border: 1.5px solid #e8f0eb;
  border-radius: 28px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.28);
  animation: card-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Brand ─────────────────────────────────────────────────── */
.brand {
  text-align: center;
  margin-bottom: 32px;
}

.brand-logo {
  width: 80px;
  height: auto;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo:hover {
  transform: scale(1.08) rotate(-2deg);
}

.brand p {
  font-size: 0.875rem;
  color: #637e6e;
  margin-top: 8px;
  font-weight: 500;
}

/* ── Form groups ───────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.72rem;
  color: #4a7a5e;
  margin-bottom: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.input-wrap {
  position: relative;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: #f7faf8;
  border: 1.5px solid #d4e8dc;
  border-radius: 12px;
  color: #0b2318;
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-group input::placeholder {
  color: #9aab9d;
}

.form-group input:focus {
  border-color: #1d5a3e;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(29, 90, 62, 0.1);
}

.form-group input[type="password"],
.form-group input[type="text"].pw-field {
  padding-right: 48px;
}

/* ── Password toggle ───────────────────────────────────────── */
.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9aab9d;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.toggle-pw:hover {
  color: #1d5a3e;
  background: rgba(29, 90, 62, 0.08);
}

/* ── Primary button ────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 13px;
  margin-top: 6px;
  background: #dda641;
  border: none;
  border-radius: 20px;
  color: #0b2318;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.2s ease,
              transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: #e8b96a;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 20px rgba(201, 151, 58, 0.4);
}

.btn-primary:active {
  transform: translateY(0) scale(0.99);
  box-shadow: none;
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  text-align: center;
  margin: 22px 0 18px;
  position: relative;
  color: #9aab9d;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: #e1ebe4;
}

.divider::before { left: 0; }
.divider::after  { right: 0; }

/* ── Switch link ───────────────────────────────────────────── */
.switch-link {
  text-align: center;
  font-size: 0.85rem;
  color: #7a9e8a;
}

.switch-link a {
  color: #1d5a3e;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

.switch-link a:hover {
  color: #c9973a;
  text-decoration: underline;
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 0.85rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: alert-in 0.3s ease both;
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-error {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #b91c1c;
}

.alert-success {
  background: #f0fdf4;
  border: 1.5px solid #a7f3d0;
  color: #065f46;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  body { padding: 16px; }

  .auth-card {
    padding: 32px 24px;
    border-radius: 24px;
  }

  .brand-logo { width: 70px; }

  .form-group input {
    font-size: 0.875rem;
    padding: 11px 14px;
  }

  .btn-primary {
    font-size: 0.875rem;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .brand-logo { width: 60px; }

  .form-group label { font-size: 0.7rem; }
}

@media (max-width: 400px) {
  body {
    padding: 16px 10px;
  }

  .auth-card {
    padding: 24px 16px;
    border-radius: 20px;
    width: 100%;
  }

  .brand { margin-bottom: 24px; }
  .brand-logo { width: 56px; }
  .brand p { font-size: 0.8rem; }

  .form-group {
    margin-bottom: 14px;
  }

  .form-group label {
    font-size: 0.68rem;
    margin-bottom: 5px;
  }

  .form-group input {
    font-size: 0.85rem;
    padding: 10px 12px;
    border-radius: 10px;
  }

  .btn-primary {
    font-size: 0.85rem;
    padding: 11px;
    border-radius: 18px;
  }

  .divider { margin: 16px 0 14px; }
  .switch-link { font-size: 0.8rem; }
}

/* ── Verify 2FA (reused in login.css) ─────────────────────── */
.verify-2fa-container {
  max-width: 450px;
  margin: 80px auto;
  padding: 40px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  text-align: center;
  border: 1.5px solid #e8f0eb;
}

.verify-2fa-container h2 {
  color: #0b2318;
  margin-bottom: 10px;
  font-size: 1.5rem;
  font-weight: 800;
}

.verify-2fa-container .subtitle {
  color: #7a9e8a;
  margin-bottom: 30px;
  font-size: 0.875rem;
}

.verify-2fa-container .user-info {
  background: #f7faf8;
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 24px;
  color: #0b2318;
  border: 1.5px solid #e2ede6;
  font-size: 0.9rem;
}

.otp-input {
  width: 100%;
  padding: 14px;
  font-size: 1.6rem;
  text-align: center;
  letter-spacing: 10px;
  border: 1.5px solid #d4e8dc;
  border-radius: 12px;
  margin: 20px 0;
  font-family: monospace;
  background: #f7faf8;
  color: #0b2318;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.otp-input:focus {
  border-color: #1d5a3e;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(29, 90, 62, 0.1);
}

.error-message {
  background: #fef2f2;
  color: #b91c1c;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1.5px solid #fecaca;
  font-size: 0.875rem;
}

.btn-verify {
  width: 100%;
  background: #c9973a;
  color: #0b2318;
  padding: 13px;
  border: none;
  border-radius: 20px;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease,
              transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease;
}

.btn-verify:hover {
  background: #e8b96a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 151, 58, 0.4);
}

.btn-verify:disabled {
  background: #d4e8dc;
  color: #9aab9d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.back-link {
  display: block;
  margin-top: 20px;
  color: #7a9e8a;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.back-link:hover { color: #0b2318; }

.help-text {
  margin-top: 20px;
  padding: 14px;
  background: #f7faf8;
  border-radius: 12px;
  font-size: 0.82rem;
  color: #4a7a5e;
  border: 1.5px solid #e2ede6;
  text-align: left;
}

.lock-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

/* ── Inline field errors ───────────────────────────────────── */
.form-group.field-error input {
  border-color: #f43f5e;
  background: #fff5f7;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

.form-group.field-error label {
  color: #e11d48;
}

.field-error-msg {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e11d48;
  animation: alert-in 0.25s ease both;
}

.field-error-msg svg {
  flex-shrink: 0;
}

.field-error-general {
  margin-bottom: 14px;
}

/* ── ≤360px fixes ──────────────────────────────────────────── */
@media (max-width: 360px) {
  body { padding: 14px 8px; }

  .auth-card {
    padding: 20px 12px;
    border-radius: 16px;
  }

  .brand { margin-bottom: 20px; }
  .brand-logo { width: 50px; }
  .brand p { font-size: 0.76rem; }

  .form-group { margin-bottom: 12px; }

  .form-group label {
    font-size: 0.64rem;
    margin-bottom: 4px;
  }

  .form-group input {
    font-size: 0.82rem;
    padding: 9px 11px;
    border-radius: 9px;
  }

  .btn-primary {
    font-size: 0.82rem;
    padding: 10px;
    border-radius: 16px;
  }

  .divider { margin: 14px 0 12px; font-size: 0.72rem; }
  .switch-link { font-size: 0.76rem; }

  /* 2FA verify card */
  .verify-2fa-container {
    margin: 40px 0;
    padding: 24px 14px;
    border-radius: 18px;
  }

  .verify-2fa-container h2 { font-size: 1.2rem; }

  .otp-input {
    font-size: 1.3rem;
    letter-spacing: 6px;
    padding: 12px;
    border-radius: 12px;
  }
}
