:root{
  --login-brand: var(--brand);
}
/* Selection */
::selection{
  background: var(--login-brand);
  color: #fff;
}

body.login-body{
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100vh;
  padding-bottom: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 10%, rgba(64,78,120,0.35), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(239,184,78,0.18), transparent 45%),
    #0b0c12;
  font-family: "Google Sans","Segoe UI",sans-serif;
  color: #e9ebf5;
}

.login-shell{
  width: 100%;
  max-width: 780px;
  height: auto;
  min-height: 100vh;
  padding: 24px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  display: flex;
  justify-content: center;
  align-items: stretch;
  box-sizing: border-box;
}

.login-card{
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 0 18px;
  width: 100%;
  max-width: 620px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  height: auto;
  min-height: 100%;
}
.login-top{
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 22px;
}
.login-main{
  flex: 0 0 auto;
}
.login-stack{
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top:40px;
}
.login-foot{
  flex: 0 0 auto;
  margin-top: auto;
  padding-bottom: 30px;
}

.login-logo{
  text-align: center;
  margin: 0 0 12px;
}
.login-logo img{
  width: clamp(90px, 18vw, 130px);
  height: auto;
  box-shadow: 0px 0px 16px 0px #fffcb642;
  border-radius: 9999px;
  margin: 25px auto 10px;
}
.login-logo h1{
  margin: 4px 0 4px;
  font-size: 30px;
  color: var(--login-brand);
  font-weight: 600;
}
.login-logo p{
  margin: 0;
  color: #9aa3bf;
  font-size: 14px;
}

.welcome{
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 8px;
}
.welcome .emoji{
  font-size: 30px;
  line-height: 1;
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
}
.welcome h3{
  margin: 0 0 4px;
  font-size: 22px;
  color: #f5f7fb;
}
.welcome p{
  margin: 0;
  color: #b3bbce;
}
.welcome a{
  color: var(--login-brand);
  text-decoration: none;
}
.welcome a:hover{
  text-decoration: underline;
}

.auth-alert{
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin: 8px 0 10px;
  align-self: stretch;
}
.auth-alert.error{
  background: #ffe8e61c;
  border: 1px solid #f5b1aa;
  color: rgb(255 94 123);
}
.auth-alert.success{
  background: #e4f7e91a;
  border: 1px solid #b4e5c2;
  color: rgb(86 221 121);
}

.social-login{
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 14px 0 12px;
}
.social-login.hide-facebook .login-with-facebook-btn{
  display: none;
}
.social-login.hide-facebook .login-with-google-btn{
  flex: 1 1 100%;
}
.login-with-google-btn,
.login-with-facebook-btn{
  transition: background-color .3s, box-shadow .3s;
  /*padding: 14px 16px 14px 42px;*/
  border: none;
  border-radius: 6px;
  box-shadow: 0 -1px 0 rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .18);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
}
.login-with-google-btn{
  background-color: #FFFFFF;
  background-repeat: no-repeat;
  background-position: 12px center;
  color: #555;
  flex: 1 1 70%;
  min-width: 0;
  position: relative;
  padding-left: 48px;
  text-align: center;
}
.login-with-google-btn::before{
  content: "";
  position: absolute;
  left: 12px;
  width: 28px;
  height: 28px;
  background-image: url(../images/icons/google.svg);
  background-size: 28px 28px;
  background-repeat: no-repeat;
  background-position: center;
}
.login-with-facebook-btn{
  background-image: url(../images/icons/facebook.svg);
  background-size: 24px 24px;
  background-color: #1877F2;
  color: white;
  background-repeat: no-repeat;
  background-position: center;
  flex: 0 0 30%;
  min-width: 48px;
}
.login-with-google-btn:hover,
.login-with-facebook-btn:hover{
  box-shadow: 0 -1px 0 rgba(0, 0, 0, .04), 0 2px 4px rgba(0, 0, 0, .25);
}
.login-with-google-btn:active,
.login-with-facebook-btn:active{
  background-color: #eeeeee;
}
.login-with-facebook-btn:active{
  background-color: #1565d4;
}
.login-with-google-btn:focus,
.login-with-facebook-btn:focus{
  outline: none;
  box-shadow: 0 -1px 0 rgba(0, 0, 0, .04), 0 2px 4px rgba(0, 0, 0, .25), 0 0 0 3px #c8dafc;
}
.login-with-google-btn:disabled,
.login-with-facebook-btn:disabled{
  filter: grayscale(100%);
  background-color: #ebebeb;
  box-shadow: 0 -1px 0 rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .25);
  cursor: not-allowed;
}

.separator{
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: #9aa3bf;
  font-size: 14px;
}
.separator::before,
.separator::after{
  content: '';
  flex: 1;
  border-bottom: 1px solid #2b3648;
}
.separator:not(:empty)::before{ margin-right: .25em; }
.separator:not(:empty)::after{ margin-left: .25em; }

.login-form{
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
  width: 100%;
  overflow: visible;
}
.login-form .field{
  width: 100%;
  margin-bottom: 12px;
  position: relative;
}
.login-form label{
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: #b7c0d0;
}
.login-form .hint{
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}
.login-form .hint a{
  color: var(--login-brand);
  font-weight: 600;
  text-decoration: none;
}
.login-form .hint a:hover{
  text-decoration: underline;
}
.backup-explainer{
  width: 100%;
  margin: 2px 0 10px;
  font-size: 13px;
  color: #b3bbce;
}
.backup-explainer strong{
  display: block;
  color: var(--login-brand);
  font-weight: 700;
  margin-top: -10px;
  margin-bottom: 5px;
  font-style: italic;
  text-align: right;
}
.login-form input[type="email"],
.login-form input[type="text"],
.login-form input[type="password"],
.login-form select.auth-input{
  width: 100%;
  padding: 12px;
  /*margin-top: 10px;*/
  margin-bottom: 10px;
  border: 1px solid #2b3648;
  background: #0f1622;
  color: #e9edf6;
  border-radius: 6px;
  font-size: 15px;
  box-sizing: border-box;
  height: 44px;
}
.login-form .password-field input{
  padding-right: 44px;
}
.login-form input[type="tel"]{
  height: 44px;
}
.phone-row{
  display: flex;
  gap: 8px;
}
.phone-code{
  width: 34%;
}
.phone-input{
  width: 66%;
}
.iti{
  width: 100%;
  position: relative;
}
.iti__dropdown-content{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 1200;
}
.iti--fullscreen-popup.iti--container{
  position: relative;
  padding: 0;
}
.iti--allow-dropdown{
  width: 100%;
}
.iti__country-list{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  max-height: min(320px, calc(100vh - var(--nav-h) - 24px));
  overflow-y: auto;
  left: 0;
  right: 0;
}
.iti__search-input{
  width: 100%;
  box-sizing: border-box;
}
.iti__dropdown-content{
  width: 100%;
}
.iti--separate-dial-code .auth-input{
  padding-left: 96px;
}
.iti__selected-flag{
  background: #0f1622;
  border-right: 0;
  border-radius: 6px 0 0 6px;
}
.iti__selected-flag:focus{
  outline: none;
}
.iti__country-list{
  background: #111827;
  border: 1px solid #2b3648;
  color: #e9edf6;
}
.iti__country{
  color: #e9edf6;
}
.iti__country:hover,
.iti__country.iti__highlight{
  background: rgba(255,255,255,0.06);
}
.iti__dial-code{
  color: #9aa3bf;
}

.iti--fullscreen-popup.iti--container {
  position: relative !important; 
  padding: 0px !important;
}

.iti__flag {
    box-shadow: 0px 0px 6px 0px #ffffff40 !important;
}

.field-row{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: nowrap;
  margin-bottom: 0;
  width: 100%;
}
.field-row .field{
  flex: 1 1 0;
  margin-bottom: 0;
  min-width: 0;
  width: 100%;
}
.field-row .auth-input,
.field-row select.auth-input{
  width: 100%;
}
.field-row + .field-row{
  margin-top: 12px;
}
.terms-field{
  margin-top: 2px;
}
.terms-check{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: #b7c0d0;
}
.terms-check input{
  margin-top: 3px;
}
.terms-check a{
  color: var(--login-brand);
  text-decoration: none;
}
.terms-check a:hover{
  text-decoration: underline;
}
.voucher-field .auth-input{
  border: 1px dashed rgba(255,221,113,0.6) !important;
  background: rgba(255,221,113,0.08) !important;
  color: #f5e7a6 !important;
}
.voucher-field .auth-input:focus{
  outline: 2px solid rgba(255,221,113,0.6);
  border-color: rgba(255,221,113,0.85);
}
.country-modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6,8,12,0.7);
  z-index: 1400;
  padding: 16px;
}
.country-modal.active{
  display: flex;
}
.country-modal-card{
  width: min(420px, 92vw);
  background: #0f131c;
  color: #f1f3f8;
  border: 1px solid #1f2633;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  text-align: center;
}
.loading-spinner{
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--login-brand);
  border-radius: 50%;
  margin: 6px auto 12px;
  animation: spin 0.9s linear infinite;
}
.country-modal-card h4{
  margin: 0 0 14px 0;
  font-size: 16px;
}

#confirmCountrySelect{
  margin-top:20px;
}

.country-modal-actions{
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.auth-btn.auth-btn--ghost{
  background: #1e2633;
  color: #e8ecf5;
  border: 1px solid #2c3545;
}
.country-disclaimer{
  margin: 12px 0 0;
  font-size: 12px;
  color: #9aa3bf;
}
.login-form input::placeholder{
  color: #7d8798;
}
.req{ color: #b00020; }
.forgot-password{
  align-self: flex-end;
  margin-top: 2px;
  color: var(--login-brand);
  text-decoration: none;
  font-size: 14px;
}
.forgot-password:hover{
  text-decoration: underline;
}
.login-form button{
  width: 100%;
  padding: 12px;
  background-color: var(--login-brand);
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  margin-top: 16px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}
.login-form button:hover{
  background-color: var(--brand-hover);
}

.footer-links{
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 0;
  padding-top: 10px;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 6px);
  font-size: 15px;
  color: #9aa3bf;
}
.footer-links a{
  color: #9aa3bf;
  text-decoration: none;
}
.footer-links a:hover{
  text-decoration: underline;
}



@media (max-width: 768px){
  .login-shell{
    padding: 16px 12px calc(var(--nav-h) + env(safe-area-inset-bottom) - 30px);
    height: auto;
    min-height: 100vh;
  }
  .login-card{
    padding: 8px 10px;
    height: auto;
    min-height: 100%;
  }
  .login-with-google-btn,
  .login-with-facebook-btn{
    flex: 1 1 auto;
  }
  .footer-links{
    gap: 16px;
    font-size: 14px;
  }
}

/* Prevent iOS input zoom */
@media (hover: none) and (pointer: coarse) {
  input, textarea, select {
    font-size:16px;
  }
}

/* Blue + white theme overrides */
body.login-body{
  background:
    radial-gradient(circle at 10% 10%, rgba(66,133,244,0.12), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(189,232,245,0.18), transparent 45%),
    #f7fbff;
  color: #0F2854;
}
.login-logo h1{ color: #1C4D8D; }
.login-logo p{ color: #4b5d7a; }
.welcome h3{ color:#0F2854; }
.welcome p{ color:#4b5d7a; }
.login-form input[type="email"],
.login-form input[type="text"],
.login-form input[type="password"],
.login-form select.auth-input{
  background: #ffffff;
  color: #0F2854;
  border: 1px solid #d9e5f6;
}
.login-form input::placeholder{ color:#7a8aa6; }
.login-form button{ background-color: #4285F4; color:#ffffff; }
.login-form button:hover{ background-color: #1C4D8D; }
.login-with-google-btn{ border:1px solid #d9e5f6; }
.separator::before,
.separator::after{ border-bottom:1px solid #d9e5f6; }
.footer-links, .footer-links a{ color:#4b5d7a; }
