/* ======================================================
   LOGIN PAGE CSS
   File: frontend/authCSS/login.css
   Purpose:
   - Styles only the login page
   - Keeps login design separated from global style.css
====================================================== */

/* ======================================================
   SECTION 1: Login page background layout
   Purpose:
   - Shows the resort background image
   - Centers the login layout
====================================================== */

.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(15, 23, 42, 0.62), rgba(15, 23, 42, 0.45)),
    url("../images/background.jpg") center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  position: relative;
}

/* ======================================================
   SECTION 2: Main login container
   Purpose:
   - Creates two-column layout for showcase and login card
====================================================== */

.auth-container {
  width: 100%;
  max-width: 1080px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

/* ======================================================
   SECTION 3: Left marketing/showcase panel
   Purpose:
   - Displays intro text and feature highlights
====================================================== */

.auth-showcase {
  background: linear-gradient(135deg,
      rgba(15, 23, 42, 0.88),
      rgba(20, 184, 166, 0.68));
  color: white;
  border-radius: 30px;
  padding: 42px 34px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ======================================================
   SECTION 4: Showcase decorative circle
   Purpose:
   - Adds soft premium decoration to the left panel
====================================================== */

.auth-showcase::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(6px);
}

/* ======================================================
   SECTION 5: Showcase badge
   Purpose:
   - Small label above the welcome heading
====================================================== */

.auth-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

/* ======================================================
   SECTION 6: Showcase heading and paragraph
   Purpose:
   - Main welcome message for guests
====================================================== */

.auth-showcase h1 {
  font-size: 2.5rem;
  line-height: 1.1;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.auth-showcase p {
  font-size: 1rem;
  line-height: 1.8;
  max-width: 480px;
  opacity: 0.96;
  position: relative;
  z-index: 1;
}

/* ======================================================
   SECTION 7: Showcase highlights
   Purpose:
   - Shows benefits of logging in
====================================================== */

.auth-highlights {
  margin-top: 24px;
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.auth-highlight {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
}

.auth-highlight strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.96rem;
}

/* ======================================================
   SECTION 8: Right login form card
   Purpose:
   - Contains email/password fields and login action
====================================================== */

.auth-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 30px;
  padding: 34px 30px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card h2 {
  color: #0f172a;
  font-size: 2rem;
  margin-bottom: 8px;
}

.auth-card .auth-subtext {
  color: #64748b;
  margin-bottom: 22px;
  line-height: 1.65;
}

/* ======================================================
   SECTION 9: Login form fields
   Purpose:
   - Styles labels, inputs, and spacing
====================================================== */

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-card label {
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  display: block;
}

.auth-card input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  outline: none;
  font-size: 1rem;
  background: #fff;
}

.auth-card input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

/* ======================================================
   SECTION 10: Password field with eye button
   Purpose:
   - Keeps show/hide password button inside input
====================================================== */

.password-input-wrap {
  position: relative;
  width: 100%;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 58px;
}

.password-eye-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: #dff7f4;
  color: #0f766e;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-eye-btn:hover {
  background: #ccfbf1;
}

/* ======================================================
   SECTION 11: Login button
   Purpose:
   - Main submit button for login form
====================================================== */

.auth-submit {
  margin-top: 6px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #14b8a6, #0f9488);
  color: white;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 14px 28px rgba(20, 184, 166, 0.2);
}

.auth-submit:hover {
  transform: translateY(-1px);
}

/* ======================================================
   SECTION 12: Forgot password link
   Purpose:
   - Gives user access to account recovery
====================================================== */

.forgot-link {
  margin-top: -4px;
  text-align: right;
}

.forgot-link a {
  color: #0f766e;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
}

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

/* ======================================================
   SECTION 13: Register link and messages
   Purpose:
   - Displays navigation to register page and login feedback
====================================================== */

.auth-link {
  margin-top: 18px;
  text-align: center;
  color: #475569;
  line-height: 1.6;
}

.auth-link a {
  color: #14b8a6;
  text-decoration: none;
  font-weight: 800;
}

.message {
  margin-top: 14px;
  text-align: center;
  font-weight: 700;
}

/* ======================================================
   SECTION 14: Login message toast fix
   Purpose:
   - Prevents login message from pushing the login card layout
====================================================== */

/* Inline message is only a fallback when toast.js fails to load.
   Under normal operation the centered toast is used instead. */
#loginMessage[hidden] { display: none !important; }
#loginMessage:not([hidden]) {
  position: static;
  width: 100%;
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: 12px;
  background: #e0f2fe;
  color: #0c4a6e;
  font-size: 0.9rem;
  text-align: center;
  overflow-wrap: anywhere;
}
#loginMessage.error:not([hidden]) {
  background: #fee2e2;
  color: #991b1b;
}
#loginMessage.success:not([hidden]) {
  background: #dcfce7;
  color: #166534;
}

/* ======================================================
   SECTION 15: Legacy password button support
   Purpose:
   - Keeps older password toggle class names styled if still used
====================================================== */

.password-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.password-group input {
  flex: 1;
}

.toggle-password,
.eye-toggle {
  border: none;
  border-radius: 14px;
  background: #0f172a;
  color: #ffffff;
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover,
.eye-toggle:hover {
  background: #1e293b;
}

/* ======================================================
   SECTION 17: Tablet responsiveness
   Purpose:
   - Converts login layout to single-column on smaller screens
====================================================== */

@media (max-width: 900px) {
  .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    order: 2;
    padding: 28px 22px;
  }

  .auth-card {
    order: 1;
  }

  .auth-showcase h1 {
    font-size: 2rem;
  }
}

/* ======================================================
   SECTION 18: Mobile responsiveness
   Purpose:
   - Makes form comfortable on narrow screens
====================================================== */

@media (max-width: 480px) {
  .auth-page {
    padding: 18px 12px;
  }

  .auth-card,
  .auth-showcase {
    border-radius: 22px;
  }

  .auth-card {
    padding: 24px 18px;
  }

  .auth-showcase {
    padding: 24px 18px;
  }

  .auth-card h2 {
    font-size: 1.6rem;
  }

  .auth-showcase h1 {
    font-size: 1.7rem;
  }

  .forgot-link {
    text-align: center;
  }

  .password-group {
    flex-direction: column;
    align-items: stretch;
  }

  .toggle-password {
    width: 100%;
  }

  
}

/* ======================================================
   BACK TO LANDING PAGE LINK
   Purpose:
   - Small blurred button that returns users to the landing page
   - Uses a soft background so the text is readable but not distracting
====================================================== */

.back-landing-btn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 100;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  transition: 0.2s ease;
}

.back-landing-btn:hover {
  background: rgba(15, 23, 42, 0.42);
  color: #ffffff;
}

/* ======================================================
   BACK TO LANDING PAGE LINK - MOBILE
   Purpose:
   - Prevents the button from covering the mobile form
   - Places it neatly above the card instead of fixed overlay
====================================================== */

@media (max-width: 768px) {
  .back-landing-btn {
    position: static;
    display: inline-flex;
    width: fit-content;
    margin: 0 auto 10px 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.32);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

/* ======================================================
   FINAL MOBILE FIX FOR AUTH PAGES
====================================================== */

@media (max-width: 768px) {
  .auth-page {
    align-items: center;
    padding-top: 54px;
  }

  .auth-showcase,
  .register-showcase {
    display: none !important;
  }

  .auth-container,
  .register-container {
    grid-template-columns: 1fr !important;
    max-width: 430px;
  }

  .back-landing-btn {
    position: fixed !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 9999 !important;
    display: inline-flex !important;
    width: auto !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.38) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}
/* Keep the login card fully responsive when browser width is narrow.
   Popup notifications remain fixed overlays, never flex children. */
.auth-container,
.auth-card {
  min-width: 0;
}
@media (max-width: 768px) {
  .auth-container {
    width: 100%;
    margin-inline: auto;
  }
}
