/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  color: #444;
  overflow-x: hidden;
}

/* Background with image + blue overlay */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #1592d2;
}

.page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 35%) ,
    linear-gradient(#1592d2 0%, #1592d2 45%, #0d6aa2 100%),
    url("https://promail.ptd.net/img/new-back-ground-image.png") bottom center /
      cover no-repeat;
  filter: none;
}

/* Center wrapper */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Card */
.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 3px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  padding: 40px 48px 32px;
  position: relative;
}

/* Logo row */
.logo-row {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
}

.logo-img {
  max-width: 220px;
  width: 100%;
  height: auto;
}

/* Title */
.card-title {
  font-size: 22px;
  margin-bottom: 24px;
  color: #555;
  text-align: left;
}

/* Message */
.message {
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 3px;
  text-align: center;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Attempt notice */
.attempt-notice {
  padding: 10px;
  margin-bottom: 20px;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
  border-radius: 3px;
  text-align: center;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: 13px;
  margin-bottom: 4px;
  color: #666;
}

.field-input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 2px;
  border: 1px solid #d2d2d2;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background-color: #fff;
}

.field-input:focus {
  border-color: #2a83c5;
  box-shadow: 0 0 0 1px rgba(42, 131, 197, 0.15);
}

/* Password row */
.password-row {
  display: flex;
  align-items: stretch;
  margin-top: 2px;
}

.password-row .field-input {
  border-radius: 2px 0 0 2px;
  border-right: none;
}

.show-btn {
  padding: 0 14px;
  font-size: 13px;
  border-radius: 0 2px 2px 0;
  border: 1px solid #d2d2d2;
  background: #f7f7f7;
  color: #555;
  cursor: pointer;
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.show-btn:hover {
  background: #ececec;
  border-color: #c4c4c4;
}

/* Spacing between fields */
.field-label + .field-input,
.field-label + .password-row {
  margin-bottom: 20px;
}

/* Actions */
.actions-row {
  display: flex;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
  row-gap: 10px;
}

.primary-btn {
  border: none;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 2px;
  background: #1584c7;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-btn:hover {
  background: #0d6ea9;
}

.primary-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
}

.stay-signed-in {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  margin-left: 16px;
  color: #666;
  cursor: pointer;
  user-select: none;
}

.stay-signed-in input {
  margin-right: 6px;
}

/* Admin Link */
.admin-link {
  margin-top: 25px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.admin-link a {
  color: #1584c7;
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s ease;
}

.admin-link a:hover {
  color: #0d6ea9;
  text-decoration: underline;
}

/* Footer */
.site-footer {
  position: fixed;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: #f0f0f0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  padding: 0 12px 4px;
}

/* ---------- RESPONSIVE ---------- */

/* Tablets & below */
@media (max-width: 768px) {
  .login-card {
    padding: 28px 22px 24px;
    max-width: 360px;
  }

  .card-title {
    text-align: center;
  }

  .actions-row {
    justify-content: center;
  }

  .stay-signed-in {
    margin-left: 0;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .login-wrapper {
    align-items: flex-start;
    padding-top: 40px;
  }

  .login-card {
    max-width: 100%;
    padding: 24px 16px 20px;
  }

  .logo-img {
    max-width: 190px;
  }

  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-btn {
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
  }

  .stay-signed-in {
    justify-content: center;
  }

  .password-row {
    flex-direction: row;
  }

  .show-btn {
    padding: 0 10px;
    font-size: 12px;
  }
}