:root{
  --login-bg: url("../photo/barangay-photo.jpg");
  --glass: rgba(14, 79, 95, 0.52);
  --glass-2: rgba(14, 79, 95, 0.35);
  --line: rgba(255,255,255,0.18);
  --line-2: rgba(255,255,255,0.26);
  --txt: #ffffff;
  --txt-soft: rgba(255,255,255,0.82);
  --focus: rgba(34,121,156,0.35);
}

.login-page{
  width:100%;
  min-height: calc(100vh - 75px);
  display:grid;
  grid-template-columns: 34% 66%;
  position:relative;
  overflow:hidden;
}

.login-page::before{
  content:"";
  position:absolute;
  inset:0;
  background-image: var(--login-bg);
  background-size: cover;
  background-position: center;
  z-index:0;
  transform: scale(1.03);
  filter: saturate(1.05) contrast(1.02);
}

.login-page::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(120deg, rgba(0,0,0,0.40), rgba(0,0,0,0.18));
  z-index:1;
}

.login-left{
  position:relative;
  z-index:2;
  background: linear-gradient(to bottom, #22799C, #b2b2b2);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:40px 24px;
  clip-path: polygon(0 0, 88% 0, 100% 100%, 0 100%);
  filter: drop-shadow(18px 0 22px rgba(0,0,0,0.35));
}

.login-left::after{
  content:"";
  position:absolute;
  top:0;
  right:-110px;
  width:160px;
  height:100%;
  background: rgba(0,0,0,0.22);
  transform: skewX(6deg);
  filter: blur(12px);
  opacity:0.75;
  pointer-events:none;
}

.login-brand{
  text-align:center;
  color: var(--txt);
}

.brand-logo{
  width:450px;
  height:450px;
  background-image: url("../photo/alalay-full-white-logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin:0 auto 16px;
  filter: drop-shadow(0 16px 28px rgba(0,0,0,0.25));
}

.brand-name{
  font-size:38px;
  font-weight:900;
  letter-spacing:2px;
}

.login-right{
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:40px;
}

.login-card{
  width:380px;
  padding:30px 28px 26px;
  border-radius:16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
    var(--glass);
  border: 1px solid var(--line);
  box-shadow:
    0 16px 40px rgba(0,0,0,0.30),
    inset 0 1px 0 rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
}

.login-title{
  color: var(--txt);
  text-align:center;
  margin-bottom:18px;
  font-size:26px;
  font-weight:900;
  letter-spacing:0.4px;
}

.login-form{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.input{
  width:100%;
  height:42px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.22);
  outline:none;
  background: rgba(255,255,255,0.94);
  font-size:13px;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.input::placeholder{
  color: rgba(0,0,0,0.45);
}

.input:focus{
  border-color: rgba(255,255,255,0.45);
  box-shadow: 0 0 0 4px var(--focus);
  background: rgba(255,255,255,0.98);
}

.input-row{
  display:flex;
  gap:10px;
  align-items:center;
}

.country-code{
  appearance:none;
  height:42px;
  border-radius:10px;
  background: rgba(0,0,0,0.26);
  color:#fff;
  padding:10px 34px 10px 12px;
  font-size:12px;
  border:1px solid rgba(255,255,255,0.22);
  cursor:pointer;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.95) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.95) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 56%,
    calc(100% - 11px) 56%;
  background-size:5px 5px, 5px 5px;
  background-repeat:no-repeat;
}

.country-code:focus{
  outline:none;
  border-color: rgba(255,255,255,0.40);
  box-shadow: 0 0 0 4px var(--focus);
  background: rgba(0,0,0,0.30);
}

.phone-input{ flex:1; }

.login-btn{
  margin-top:6px;
  height:44px;
  border:none;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
  font-size:13px;
  letter-spacing:0.3px;
  color:#fff;
  background: linear-gradient(180deg, #0e4f5f, #083642);
  box-shadow: 0 14px 26px rgba(0,0,0,0.28);
  transition: transform .12s ease, filter .12s ease, opacity .12s ease;
}

.login-btn:hover{
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.login-btn:active{
  transform: translateY(0);
  filter: brightness(0.98);
}

.signup-text{
  margin-top:6px;
  text-align:center;
  color: rgba(255,255,255,0.85);
  font-size:11.5px;
}

.signup-link{
  color:#ffffff;
  font-weight:900;
  text-decoration:none;
  border-bottom:1px solid rgba(255,255,255,0.40);
  padding-bottom:2px;
}

.signup-link:hover{
  border-bottom-color: rgba(255,255,255,0.85);
}

.field-label{
  display:block;
  font-size:12px;
  font-weight:700;
  color: rgba(255,255,255,0.88);
  margin: 0 0 6px;
  letter-spacing:0.2px;
}

.signup-row{
  display:flex;
  gap:12px;
  align-items:flex-end;
}

.signup-field{
  flex:1;
  min-width:0;
}

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

#signupCard .input{ border-radius:10px; }
#signupCard .country-code{ border-radius:10px; }

@media (max-width: 520px){
  .signup-row{
    flex-direction:column;
    align-items:stretch;
  }
  .phone-group{ width:100%; }
}

#loginCard{ width:360px; }

#signupCard{
  width:520px;
  padding:32px 34px;
}

.auth-msg{
  padding:10px 12px;
  border-radius:10px;
  font-size:12px;
  margin-bottom:10px;
  border:1px solid rgba(255,255,255,0.18);
  color:#fff;
}
.auth-error{ background: rgba(200,40,40,0.35); }
.auth-success{ background: rgba(40,170,90,0.30); }

@media (max-width: 860px){
  .login-page{ grid-template-columns: 1fr; }
  .login-left{ clip-path:none; }
  .login-left::after{ display:none; }
  .brand-logo{ width:260px; height:260px; }
  .login-card{ width:min(420px, 92vw); }
}

.otp-overlay{
  position:fixed;inset:0;z-index:99999;
  background:rgba(0,0,0,0.60);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  display:flex;align-items:center;justify-content:center;
  padding:1rem;
}
.otp-overlay[hidden]{ display:none; }
.otp-card{
  background:#fff;border-radius:22px;
  padding:2.4rem 2.2rem 2rem;
  width:min(440px,96vw);
  box-shadow:0 32px 80px rgba(0,0,0,0.22), 0 4px 16px rgba(0,0,0,0.10);
  display:flex;flex-direction:column;gap:1.1rem;
  animation:otpSlideIn .28s cubic-bezier(.22,1,.36,1);
  position:relative;
}
@keyframes otpSlideIn{from{transform:translateY(28px);opacity:0}to{transform:none;opacity:1}}
.otp-icon{color:#0f6278;display:flex;justify-content:center;margin-bottom:.1rem;}
.otp-title{font-size:1.35rem;font-weight:800;color:#0f2027;text-align:center;margin:0;letter-spacing:-.01em;}
.otp-sub{font-size:.9rem;color:#64748b;text-align:center;line-height:1.55;margin:0;}
.otp-dev-hint{background:#fffbe6;border:1px solid #ffe066;border-radius:10px;padding:.65rem .9rem;font-size:.8rem;color:#554400;line-height:1.5;}
.otp-timer-row{display:flex;align-items:center;justify-content:center;gap:.5rem;}
.otp-timer-label{font-size:.82rem;color:#778;}
.otp-timer{font-size:.95rem;font-weight:700;color:#0f6278;font-variant-numeric:tabular-nums;letter-spacing:.04em;}
.otp-timer.otp-timer--urgent{color:#d94040;animation:otpPulse 1s ease infinite;}
@keyframes otpPulse{0%,100%{opacity:1}50%{opacity:.5}}
.otp-fields{display:flex;flex-direction:column;gap:.8rem;}
.otp-field-group{display:flex;flex-direction:column;gap:.35rem;}
.otp-label{font-size:.8rem;font-weight:600;color:#334;display:flex;align-items:center;gap:.4rem;}
.otp-input{width:100%;padding:.7rem 1rem;border:1.5px solid #d0d7de;border-radius:10px;font-size:1.2rem;letter-spacing:.25em;text-align:center;color:#0f2027;background:#f7f9fb;transition:border-color .18s,box-shadow .18s;outline:none;}
.otp-input:focus{border-color:#0f6278;box-shadow:0 0 0 3px rgba(15,98,120,.12);background:#fff;}
.otp-input::placeholder{letter-spacing:.15em;color:#bbc;}
.otp-error{font-size:.83rem;color:#c0392b;text-align:center;background:#fff0f0;border-radius:8px;padding:.5rem .8rem;margin:0;}
.otp-error[hidden]{display:none;}
.otp-btn{width:100%;padding:.78rem;border:none;border-radius:12px;font-size:.95rem;font-weight:600;cursor:pointer;transition:background .18s,transform .1s;}
.otp-btn--primary{background:#0f6278;color:#fff;}
.otp-btn--primary:hover{background:#0c4f62;}
.otp-btn--primary:active{transform:scale(.98);}
.otp-btn--primary:disabled{background:#aac;cursor:not-allowed;opacity:.7;}
.otp-btn--ghost{background:transparent;color:#0f6278;border:1.5px solid #c8d8df;margin-top:-.2rem;font-size:.85rem;}
.otp-btn--ghost:hover{background:#f0f6f8;}
.otp-btn--ghost:disabled{color:#aaa;border-color:#ddd;cursor:not-allowed;}
.otp-channel-btns{display:flex;flex-direction:column;gap:.75rem;margin-top:.25rem;}
.otp-channel-btn{display:flex;align-items:center;gap:1rem;width:100%;padding:1rem 1.2rem;border:2px solid #e2e8f0;border-radius:14px;background:#f8fafc;cursor:pointer;text-align:left;transition:border-color .18s,background .18s,box-shadow .18s,transform .1s;font-family:inherit;}
.otp-channel-btn:hover{border-color:#0f6278;background:#f0f7fa;box-shadow:0 0 0 4px rgba(15,98,120,.10);transform:translateY(-1px);}
.otp-channel-btn:active{transform:translateY(0);}
.otp-channel-btn:disabled{opacity:.55;cursor:not-allowed;transform:none;}
.otp-channel-icon{font-size:1.6rem;line-height:1;flex-shrink:0;}
.otp-channel-label{font-size:1rem;font-weight:700;color:#0f2027;flex:1;display:block;}
.otp-channel-hint{font-size:.78rem;color:#64748b;font-weight:400;display:block;margin-top:1px;}