/* ===========================
   Reset & base
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

/* Let main site control header/footer */
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #ffffff;
}

/* ===========================
   Login layout
   =========================== */

.login-wrapper {
  width: 100%;
  min-height: calc(100vh - 220px); /* space for header + footer */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: transparent; /* header/footer colors show, page feels integrated */
}

.login-container {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.30);
  overflow: hidden;
  animation: slideInUp 0.6s ease-out;
  max-height: 95vh;
  overflow-y: auto;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   Header inside card
   =========================== */

.login-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  padding: 26px 22px;
  text-align: center;
  color: #ffffff;
}

.login-header .logo-icon {
  font-size: 36px;
  margin-bottom: 10px;
  display: inline-block;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.login-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.login-header p {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 500;
}

/* ===========================
   Content (form area)
   =========================== */

.login-content {
  padding: 22px 20px 20px;
}

/* Alerts */

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
  border-left: 4px solid;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background-color: #ecfdf5;
  border-color: #86efac;
  color: #065f46;
}

.alert-error {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* Form fields */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #374151;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  background-color: #f9fafb;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-group select {
  color: #374151;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  padding-right: 34px;
}

.form-group input::placeholder {
  color: #9ca3af;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2563eb;
  background-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.form-group input:hover,
.form-group select:hover {
  border-color: #d1d5db;
}

/* Remember / forgot */

.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
}

.remember-forgot input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  cursor: pointer;
  accent-color: #2563eb;
}

.remember-forgot label {
  display: flex;
  align-items: center;
  color: #6b7280;
  cursor: pointer;
}

.remember-forgot a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

/* Main login button */

.btn-login {
  width: 100%;
  padding: 11px 16px;
  border-radius: 9999px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  min-height: 44px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-login:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.6);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
}

/* Divider + secondary links */

.divider {
  text-align: center;
  margin: 18px 0;
  position: relative;
  font-size: 12px;
  color: #9ca3af;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e5e7eb;
}

.divider span {
  position: relative;
  padding: 0 8px;
  background: #ffffff;
  font-weight: 500;
}

.button-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.btn-secondary,
.btn-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 9999px;
  border: none;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  min-height: 40px;
  gap: 6px;
  color: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-secondary {
  background-color: #3b82f6;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.35);
}

.btn-warning {
  background-color: #f59e0b;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.35);
}

.btn-secondary:hover,
.btn-warning:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-secondary:active,
.btn-warning:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
}

/* Footer inside card */

.login-footer {
  background-color: #f9fafb;
  padding: 14px 18px;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.6;
}

.login-footer a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

/* ===========================
   Responsive tweaks
   =========================== */

@media (max-width: 480px) {
  .login-wrapper {
    padding: 12px 10px;
    min-height: calc(100vh - 200px);
  }

  .login-container {
    border-radius: 12px;
    max-width: 100%;
  }

  .login-header {
    padding: 22px 16px;
  }

  .login-header h1 {
    font-size: 20px;
  }

  .login-header .logo-icon {
    font-size: 32px;
  }

  .login-content {
    padding: 20px 16px 16px;
  }

  .button-group {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .login-container {
    max-width: 400px;
  }
}
