/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #e8ecef;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ===== BRAND HEADER ===== */
.brand-header {
  text-align: center;
  margin-bottom: 22px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b3fa0 0%, #2d3a8c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  box-shadow: 0 4px 16px rgba(123, 63, 160, 0.35);
}

.brand-title {
  font-size: 27px;
  font-weight: 800;
  color: #1a2340;
  line-height: 1.25;
  margin-bottom: 5px;
}

.brand-subtitle {
  font-size: 13.5px;
  color: #8a94a6;
}

/* ===== CARD ===== */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.card h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a2340;
  margin-bottom: 22px;
}

/* ===== FORM GROUPS ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #2d3a5e;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #dde2ec;
  border-radius: 8px;
  font-size: 14px;
  color: #1a2340;
  background: #f7f9fc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-group input::placeholder {
  color: #b0b8cc;
}

.form-group input:focus {
  border-color: #2d3a8c;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(45, 58, 140, 0.1);
}

/* Error States */
.form-group.has-error label {
  color: #dc2626;
}

.form-group input.is-invalid,
.form-group.has-error input {
  border-color: #dc2626;
  background: #fef2f2;
}

.form-group input.is-invalid:focus,
.form-group.has-error input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.field-error {
  display: block;
  font-size: 12px;
  color: #dc2626;
  margin-top: 6px;
  font-weight: 500;
}

/* ===== PASSWORD TOGGLE ===== */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 42px;
}

.toggle-password {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9aa3b8;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.2s;
  z-index: 10;
}

.toggle-password svg {
  pointer-events: none;
}

.toggle-password:hover {
  color: #2d3a8c;
}

.toggle-password:active svg {
  transform: scale(0.9);
}

/* ===== BUTTON ===== */
.btn-primary {
  width: 100%;
  padding: 13px;
  background: #2d3a8c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  letter-spacing: 0.3px;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: #1f2a6e;
  box-shadow: 0 4px 14px rgba(45, 58, 140, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* ===== SWITCH LINK ===== */
.switch-link {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: #6b7596;
}

.switch-link a {
  color: #2d3a8c;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
}

.switch-link a:hover {
  color: #7b3fa0;
  text-decoration: underline;
}

/* ===== ALERTS ===== */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 14px;
}

.alert-error {
  background: #fdecea;
  color: #b91c1c;
  border: 1px solid #f9c0bb;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* ===== FOOTER ===== */
.page-footer {
  margin-top: 24px;
  font-size: 12.5px;
  color: #9aa3b8;
  text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .card {
    padding: 28px 20px;
  }
  .brand-title {
    font-size: 22px;
  }
}