/* Apply box-sizing globally */
* {
  box-sizing: border-box;
}

/* Body */
body {
  font-family: "Poppins", sans-serif;
  background: #ffffff;
  margin: 0;
  min-height: 100vh;
}

/* ============ Split-screen login layout ============ */
.login-page {
  display: flex;
  min-height: 100vh;
}

/* Left: branding panel */
/* Left: branding panel */
.login-branding {
  flex: 0 0 46%;
  max-width: 46%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 40px;
  color: #FFF7E6;
  background: #1E3A34;
  overflow: hidden;
}
.login-branding::before {
  display: none;
}
.brand-logo-wrap {
  position: relative;
  width: min(320px, 78%);
  margin: 0 0 28px;
}
.brand-logo-wrap::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 247, 230, 0.42) 0%,
    rgba(75, 170, 139, 0.22) 42%,
    transparent 70%
  );
  animation: logoHalo 1.1s ease-out 0.35s both;
  pointer-events: none;
}
.login-branding .brand-logo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  background: transparent;
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 0 6px rgba(255, 247, 230, 0.12),
    0 18px 40px rgba(0, 0, 0, 0.32);
  animation: logoLand 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.login-branding h1 {
  font-size: 40px;
  font-weight: 700;
  margin: 0 0 6px;
  position: relative;
  color: #FFF7E6;
  animation: brandCopyIn 0.7s ease-out 0.28s both;
}
.login-branding .brand-kicker {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: #FFE3B3;
  margin: 0 0 18px;
  position: relative;
  animation: brandCopyIn 0.7s ease-out 0.4s both;
}
.login-branding .brand-slogan {
  font-size: 18px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.5;
  color: #FFC857;
  max-width: 380px;
  margin: 0;
  position: relative;
  animation: brandCopyIn 0.7s ease-out 0.52s both;
}
@keyframes logoLand {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(0.86);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
@keyframes logoHalo {
  from {
    opacity: 0;
    transform: scale(0.65);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes brandCopyIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-branding .brand-logo,
  .brand-logo-wrap::before,
  .login-branding h1,
  .login-branding .brand-kicker,
  .login-branding .brand-slogan {
    animation: none;
  }
}
.login-branding > p {
  font-size: 16px;
  line-height: 1.6;
  color: #FFE3B3;
  max-width: 420px;
  margin: 0 0 28px;
  position: relative;
}

/* Right: login card */
.login-container {
  flex: 0 0 54%;
  max-width: 54%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 32px 40px;
  background: #ffffff;
}

@media (max-width: 860px) {
  .login-page { flex-direction: column; }
  .login-branding { flex-basis: auto; max-width: 100%; padding: 40px 30px; }
  .login-branding > p { max-width:none; }
  .login-container { flex-basis: auto; max-width: 100%; min-height: auto; padding: 30px 20px 50px; }
}

/* Login Card */
.login-card {
  background: #1E3A34;
  border-radius: 18px;
  padding: 48px 42px;
  color: #FFF7E6;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  text-align: center;
  width: 100%;
  max-width: 460px;
}

/* Lock Icon at top */
.login-icon {
  font-size: 40px;
  background: #4BAA8B;
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  margin: 0 auto 18px;
  color: white;
  box-shadow: 0 8px 22px rgba(75, 170, 139, 0.45);
}

/* Heading & Subtitle */
.login-card h2 {
  margin: 10px 0;
  font-size: 28px;
  font-weight: 700;
  color: #FFF7E6;
}

.login-card p {
  font-size: 14px;
  color: #FFE3B3;
  margin-bottom: 25px;
}

/* Input group with icons */
.input-group {
  position: relative;
  margin-bottom: 20px;
}

/* Left icon (user/lock) */
.input-group i { 
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #FFE3B3;
    font-size: 16px;
    z-index: 5;
    /* Dito natin ilalagay ang default position (LEFT) */
    left: 12px;
    right: auto; /* Tiyakin na hindi nag-a-apply ang right property dito */
}

/* Input fields */
.input-group input {
  width: 100%;
  padding: 12px 40px 12px 40px; /* padding for icons */
  border-radius: 12px;
  border: 1px solid #4BAA8B;
  background: #1E3A34;
  color: #FFF7E6;
  font-size: 15px;
  box-sizing: border-box;
}

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

/* Country code sits in the row with the icon, so it cannot cover the number. */
.input-group.ph-signup-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #4BAA8B;
  border-radius: 8px;
  background: #1E3A34;
}
.input-group.ph-signup-phone i,
.input-group.ph-signup-phone .ph-signup-cc {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  transform: none;
  flex: 0 0 auto;
}
.ph-signup-cc {
  z-index: 6;
  font-weight: 800;
  color: #FFE3B3;
  font-size: 14px;
  line-height: 1;
}

/* Toggle password eye icon */
.toggle-password {
    /* CRITICAL FIX: I-OVERRIDE ang 'left' at 'right' */
    left: auto !important; /* Siguraduhin na hindi na gagamitin ang left: 12px */
    right: 12px;           /* Dito dapat lilitaw sa kanan */
    
    font-size: 18px; 
    cursor: pointer;
    z-index: 10; 
    
    /* Para maging compact ang clickable area (galing sa nakaraang fix) */
    width: 20px; 
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Tiyakin na gumagana ang top/transform kahit may !important */
    top: 50%;
    transform: translateY(-50%);
}

/* Demo credentials box */
.demo-credentials {
  background: #4BAA8B;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  color: #FFF7E6;
  text-align: left;
  word-wrap: break-word;
}

.demo-credentials ul {
  margin: 5px 0 0 15px;
  padding: 0;
  list-style-type: disc;
}

.demo-credentials li {
  margin-bottom: 5px;
}

/* Login Button */
button.login-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 17px;
  background: linear-gradient(180deg, #6BC4A6 0%, #4BAA8B 100%);
  color: white;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
}

button.login-btn:hover {
  background: linear-gradient(180deg, #5BB896 0%, #3E9778 100%);
}

/* Signup text */
.login-card .signup-text {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 13px;
  color: #FFE3B3;
}

.signup-text a {
  color: #4BAA8B;
  font-weight: 600;
  text-decoration: none;
}
.signup-text a:hover {
  text-decoration: underline;
}

.login-card .forgot-password-row {
  text-align: right;
  margin: -4px 4px 14px;
}
.forgot-password-row a {
  font-size: 13px;
  color: #4BAA8B;
  text-decoration: none;
}
.forgot-password-row a:hover {
  text-decoration: underline;
}

.login-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: #FFE3B3;
  font-size: 13px;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 227, 179, 0.28);
}
.login-or span {
  flex: 0 0 auto;
}

.guest-browse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 247, 230, 0.55);
  background: transparent;
  color: #FFF7E6;
  text-decoration: none;
  box-sizing: border-box;
}
.guest-browse-btn:hover {
  background: rgba(255, 247, 230, 0.06);
}
.guest-browse-btn > i {
  font-size: 18px;
}
.guest-browse-btn span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  text-align: left;
}
.guest-browse-btn strong {
  font-size: 15px;
  font-weight: 700;
}
.guest-browse-btn small {
  font-size: 12px;
  font-weight: 400;
  color: #FFE3B3;
}

.browse-shop-text{
  margin:12px 0 0;
  text-align:center;
  font-size:13px;
}
.browse-shop-text a{
  color:#FFC857;
  font-weight:700;
  text-decoration:none;
}
.browse-shop-text a:hover{ text-decoration:underline; }

/* Login/signup errors stay inside the card (theme.css .message is a corner toast). */
.login-card .message,
.login-card .toast{
  position:static;
  bottom:auto;
  right:auto;
  left:auto;
  width:100%;
  max-width:100%;
  margin:0 auto 16px;
  text-align:center;
  box-shadow:none;
  z-index:auto;
  box-sizing:border-box;
}

/* --- REGISTRATION FORM ADJUSTMENTS (Applies to Registration Page) --- */

/* 1. Ginagawang mas mataas ang card para magkasya ang maraming fields */
.login-card { 
    /* Maaari mo itong i-override sa registration page kung kailangan,
       pero para mas flexible, gawin nating variable ang height */
    max-height: 90vh; /* Itaas ang maximum height */
    overflow-y: auto; /* Nagdaragdag ng scroll bar kung masyadong maraming fields */
    /* Kung ang card ay masyadong mababa, ito ang kailangan */
}

/* 2. Binabawasan ang space sa pagitan ng input groups */
.input-group {
    margin-bottom: 12px; /* Mula 20px, ginawang 12px */
}

/* 3. Styling para sa label (form-label) */
.form-label {
    display: block;
    text-align: left;
    margin-bottom: 3px; /* Space sa pagitan ng label at input */
    font-size: 14px; /* Bahagyang mas malaki kaysa p */
    color: #FFE3B3; /* Light gray color */
    font-weight: 500;
}

/* 4. Padding adjustment (Optional: Kung kailangan ng mas malaking space sa loob ng card) */
/* .login-card {
    padding: 30px 30px; 
} */

/* 5. Tiyakin na ang input size ay hindi mag-o-overlap */
.input-group input {
    font-size: 14px; 
    padding: 10px 40px 10px 40px; /* Bawasan ang padding kung sobrang laki */
}
.input-group.ph-signup-phone input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 10px 0;
    border-radius: 0;
}

/* 6. I-hide ang demo credentials sa registration page */
/* Kung ginagamit mo ang parehong HTML base at gusto mong itago ito sa register page */
/* Maaari mong i-override ito gamit ang body class, o tanggalin na lang sa HTML */

/* --- ICON ALIGNMENT FIXES --- */

/* I-adjust ang icon size sa loob ng top-most login-icon */
.login-icon i { 
    font-size: 30px; 
}

/* Tiyakin na ang toggle password icon ay hindi maapektuhan ng ibang rules */
.input-group .toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #FFE3B3;
    font-size: 18px;
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    left: auto;
}
.input-group .toggle-password i {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    color: inherit;
    font-size: 16px;
}

.pw-hints .pw-rules {
    list-style: none;
    padding: 0;
    margin: -6px 0 16px;
    font-size: 12.5px;
    color: #FFE3B3;
    text-align: left;
}
.pw-hints .pw-rules li {
    margin: 4px 0;
    padding-left: 18px;
    position: relative;
}
.pw-hints .pw-rules li::before {
    content: "○";
    position: absolute;
    left: 0;
}
.pw-hints .pw-rules li.ok {
    color: #FFC857;
}
.pw-hints .pw-rules li.ok::before {
    content: "●";
}
/* ============ Sign Up Popup Modal (index.php) ============ */
.login-page.blurred > * {
  filter: blur(4px);
  transition: filter 0.25s ease;
  pointer-events: none;
  user-select: none;
}

.signup-modal-overlay {
  display: none;
}

.signup-modal-overlay.active {
  display: flex;
}

.signup-modal-card {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: signupModalIn 0.2s ease;
}

.signup-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 22px;
  color: #FFE3B3;
  cursor: pointer;
  line-height: 1;
}
.signup-modal-close:hover {
  color: #FFF7E6;
}

@keyframes signupModalIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#loginForm .input-group {
  margin-bottom: 14px;
}
#loginForm .input-group input {
  padding: 13px 42px;
  font-size: 15px;
  border-radius: 12px;
}