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

html {
  background: #4a7c59;
}

body {
  font-family: 'Signika Negative', 'Segoe UI', Tahoma, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/*
  Map background + soft scrim, pinned to the screen.
  A fixed layer (instead of background-attachment: fixed, which
  phones ignore) keeps the image covering the whole screen while
  the form scrolls — no bare green strip at the bottom.
*/
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 40%,
      rgba(45, 90, 61, 0.10) 0%,
      rgba(45, 90, 61, 0.45) 100%),
    #4a7c59 url("../images/background.jpg") center center / cover no-repeat;
  pointer-events: none;
}

.auth-container {
  background: rgba(74, 124, 89, 0.92);
  backdrop-filter: blur(2px);
  border-radius: 20px;
  padding: 50px 45px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

/* Logo */
.logo {
  text-align: center;
  margin-bottom: 30px;
}

/* Brand icon */
.logo-icon {
  display: block;
  width: 115px;
  height: auto;
  margin: 0 auto 14px;
}

/* Brand wordmark */
.logo-name {
  display: block;
  width: 250px;
  max-width: 70%;
  height: auto;
  margin: 0 auto;
}

/* legacy text fallback */
.logo h1 {
  color: white;
  font-size: 37px;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo h1 span {
  color: #c5e1a5;
}

/* Form styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.input-group {
  position: relative;
}

.input-group input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 15px 15px 15px 45px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  color: #333;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(197, 225, 165, 0.5);
}

.input-group input::placeholder {
  color: #888;
}

.input-group .icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #4a7c59;
  font-size: 18px;
}

/* PASSWORD REQUIREMENTS */

.password-requirements {
  background: rgba(255, 255, 255, 0.10);
  border-radius: 10px;

  padding: 12px 14px;

  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 8px 12px;
}

.password-requirements p {
  grid-column: 1 / -1;

  color: white;

  font-size: 14px;
  font-weight: 700;

  margin-bottom: 2px;
}

.requirement {
  display: flex;
  align-items: center;

  gap: 8px;

  font-size: 13px;

  transition:
    color 0.2s ease;
}

.requirement i {
  width: 16px;

  text-align: center;

  transition:
    color 0.2s ease;
}


/* FAILED REQUIREMENT */

.requirement.invalid {
  color: #ffd0d0;
}

.requirement.invalid i {
  color: #ff6b6b;
}


/* PASSED REQUIREMENT */

.requirement.valid {
  color: #dcf8df;
}

.requirement.valid i {
  color: #8be39b;
}


/* CONFIRM PASSWORD MATCH */

.input-group input.password-match-valid {
  box-shadow:
    0 0 0 2px
    rgba(139, 227, 155, 0.9);
}

.input-group input.password-match-invalid {
  box-shadow:
    0 0 0 2px
    rgba(255, 107, 107, 0.8);
}


/* MOBILE */

@media (max-width: 420px) {

  .password-requirements {
    grid-template-columns: 1fr;
  }

  .password-requirements p {
    grid-column: auto;
  }

}

/* Submit button */
.btn-submit {
  background: #2d5a3d;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
}

.btn-submit:hover {
  background: #1e4a2d;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.btn-submit:disabled {
  background: #6b8f7a;
  cursor: not-allowed;
  transform: none;
}

/* Verification code inputs */
.verification-title {
  color: white;
  text-align: center;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.code-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;

  /* keeps the boxes off the edges of the card */
  padding: 0 6px;

  margin-bottom: 20px;
}

.code-inputs input {
  /* shrink to fit narrow screens instead of overflowing the card */
  flex: 1 1 0;
  min-width: 0;
  max-width: 55px;

  height: 60px;
  aspect-ratio: 55 / 60;
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  transition: all 0.3s ease;
}

.code-inputs input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(197, 225, 165, 0.5);
  transform: scale(1.05);
}

/* Links */
.auth-links {
  text-align: center;
  margin-top: 20px;
}

.auth-links a {
  color: #c5e1a5;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s ease;
}

.auth-links a:hover {
  color: white;
  text-decoration: underline;
}

.auth-links p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
}

/* Resend code */
.resend-section {
  text-align: center;
  margin-top: 15px;
}

.resend-section p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  margin-bottom: 5px;
}

.btn-resend {
  background: none;
  border: none;
  color: #c5e1a5;
  font-size: 16px;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.btn-resend:hover {
  color: white;
}

.btn-resend:disabled {
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
}

/* Messages */
.message {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 16px;
  text-align: center;
  display: none;
}

.message.error {
  background: rgba(244, 67, 54, 0.2);
  color: #ffcdd2;
  border: 1px solid rgba(244, 67, 54, 0.3);
  display: block;
}

.message.success {
  background: rgba(76, 175, 80, 0.2);
  color: #c8e6c9;
  border: 1px solid rgba(76, 175, 80, 0.3);
  display: block;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 420px) {
  .auth-container {
    padding: 30px 20px;
  }
  
  .code-inputs {
    gap: 8px;
  }

  .code-inputs input {
    max-width: 50px;
    height: 55px;
    font-size: 23px;
  }
}

/* ========================================
   LOGIN TYPE SELECTION
======================================== */

[hidden] {
    display: none !important;
}

.login-question {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 20px;
    font-size: 17px;
}

.login-type-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.login-type-btn {
    min-height: 130px;

    border: 2px solid
        rgba(255, 255, 255, 0.15);

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.08);

    color: white;

    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 8px;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.login-type-btn i {
    font-size: 34px;
    color: #c5e1a5;
}

.login-type-btn span {
    font-weight: 700;
    font-size: 18px;
}

.login-type-btn small {
    font-size: 13px;
    opacity: 0.75;
}

.login-type-btn:hover {
    transform: translateY(-3px);

    background:
        rgba(255, 255, 255, 0.14);

    border-color: #c5e1a5;
}


/* USER / ADMIN PANEL TITLE */

.login-panel-header {
    display: grid;

    grid-template-columns:
        36px 1fr 36px;

    align-items: center;

    margin-bottom: 20px;
}

.login-panel-header h2 {
    grid-column: 2;

    text-align: center;

    color: white;

    font-size: 21px;
}

.back-login-btn {
    grid-column: 1;

    width: 36px;
    height: 36px;

    border: none;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.1);

    color: white;

    cursor: pointer;
}

.back-login-btn:hover {
    background:
        rgba(255, 255, 255, 0.2);
}


@media (max-width: 420px) {
    .login-type-buttons {
        grid-template-columns: 1fr;
    }

    .login-type-btn {
        min-height: 100px;
    }
}


/* ===========================================================
   TYPEFACE — Signika (Google Fonts, OFL)
   Loaded via <link> in each page head.
=========================================================== */

html,
body,
button,
input,
select,
textarea {
    font-family: 'Signika Negative', 'Segoe UI', Tahoma, sans-serif;

    /* SemiBold is the base weight for this design */
    font-weight: 600;
}


/* ===========================================================
   SHOW / HIDE PASSWORD (eye)
=========================================================== */

.input-group.has-toggle input,
.password-wrap input {
  padding-right: 48px;
}

.password-wrap {
  position: relative;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);

  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 8px;
  background: transparent;

  color: #4a7c59;
  font-size: 17px;

  cursor: pointer;
  z-index: 2;
}

.toggle-password:hover,
.toggle-password:focus-visible {
  background: rgba(74, 124, 89, 0.10);
  outline: none;
}

/* hide the browser's own reveal button (Edge) so there is only one eye */
input::-ms-reveal,
input::-ms-clear {
  display: none;
}


/* ===========================================================
   INLINE FIELD ERRORS (incomplete email, etc.)
=========================================================== */

.field-error {
  display: none;
  margin-top: -8px;
  padding-left: 4px;

  color: #ffd0d0;
  font-size: 14px;
}

.field-error.show {
  display: block;
}

.input-group input.input-invalid {
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.85);
}


/* ===========================================================
   BIRTHDAY (date) BOX — same size as the other boxes on phones
=========================================================== */

.input-group input[type="date"] {
  -webkit-appearance: none;
  appearance: none;

  min-width: 0;
  line-height: 22px;
  text-align: left;
}

.input-group input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}

.input-group input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}

.date-placeholder {
  position: absolute;
  left: 45px;
  top: 50%;
  transform: translateY(-50%);

  color: #888;
  font-size: 16px;

  pointer-events: none;
  display: none;
}

/* empty + not focused: show "Birthday" instead of mm/dd/yyyy */
.date-group.date-empty input[type="date"]:not(:focus) {
  color: transparent;
}

.date-group.date-empty input[type="date"]:not(:focus) + .date-placeholder {
  display: block;
}


/* ===========================================================
   FORGOT PASSWORD
=========================================================== */

.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.forgot-link {
  color: #c5e1a5;
  font-size: 15px;
  text-decoration: none;
}

.forgot-link:hover {
  color: white;
  text-decoration: underline;
}

.step-hint {
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  font-size: 15px;
  line-height: 1.45;
  margin: -6px 0 20px;
  overflow-wrap: anywhere;
}

.step-hint strong {
  color: #c5e1a5;
}

.countdown-text {
  color: #c5e1a5;
  margin-top: 5px;
}


/* ===========================================================
   PHONE
=========================================================== */

@media (max-width: 420px) {
  body {
    padding: 16px;
    align-items: flex-start;
  }

  /* centred when it fits, scrolls from the top when it doesn't */
  .auth-container {
    margin: auto 0;
  }

  .logo-icon {
    width: 90px;
  }

  .logo {
    margin-bottom: 22px;
  }
}

/* Sign up / login by mobile number */
.btn-link {
  display: block;
  margin: 10px auto 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover {
  color: white;
}

.auth-links p + p {
  margin-top: 10px;
}

.auth-links .guest-link {
  font-size: 15px;
  opacity: 0.85;
}

/* "Sign Up" link glows after a login with an unregistered number */
.auth-links a.attention {
  color: white;
  font-weight: 700;
  text-decoration: underline;
}

/* "Log in or sign up to save your trip" note */
.message.info {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: block;
}
