/*
** Login & Register Page Styles V2 for OpenCart
** Enhanced for improved responsiveness on all devices.
*/

body {
  background-color: #f1f1f1;
  /* Fix for iOS text rendering issues */
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-style: normal !important;
}
.site-wrapper {
  justify-content: center;
}
.custom-form-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  min-height: 100vh;
}
.custom-form-wrapper {
  display: flex;
  max-width: 1000px;
  width: 100%;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  overflow: hidden;
  min-height: 600px;
}

/* New: Image Position Right */
.custom-form-wrapper.image-position-right {
  flex-direction: row-reverse;
}

.form-image-section {
  flex: 1;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  background-color: #edf4ff;
  position: relative;
  background-size: 80% auto;
}
.form-content-section {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  position: relative;
}
.custom-form {
  font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
  width: 100%;
  max-width: 400px;
  /* iOS text fix */
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-style: normal !important;
  font-variation-settings: 'slnt' 0 !important; /* Force no slant for variable fonts */
}
.form-logo {
  text-align: left;
  margin-bottom: 20px;
}
.form-logo.image-logo {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 5;
}
.form-logo img {
  max-width: 150px;
  height: auto;
}
a {
  text-decoration: none;
}
.custom-form h2 {
  margin-bottom: 5px;
  font-size: 24px;
  font-weight: bold;
  color: rgba(50, 35, 111, 1);
  line-height: 1.7;
}
.custom-form h3 {
  margin-bottom: 25px;
  margin-top: 0px;
  font-weight: normal;
  font-size: 16px;
  color: #666;
}
.custom-form a {
  color: #337ab7;
  text-decoration: none;
}
.custom-form a:visited {
  color: #004c8d;
}
.custom-form .btn-primary {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px !important;
  background: linear-gradient(95.49deg, #60a6ff -36.87%, #194174 95%);
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.3s;
}
.custom-form .checkbox-label {
  display: block;
  position: relative;
  padding-left: 28px;
  font-weight: normal;
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: 10px;
  cursor: pointer;
}
.custom-form .checkbox-label input[type="checkbox"] {
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
}
.text-danger {
  color: #ff1800 !important;
  font-size: 13px;
  padding-top: 5px;
  padding-bottom: 5px;
  min-height: 0px;
  margin-top: 0px;
}
.image-footer-text {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-weight: normal;
  font-size: 14px;
  color: #6c757d;
  font-family: 'Poppins', sans-serif;
  background: rgb(255 255 255 / 70%);
  padding: 5px 10px;
  border-radius: 5px;
  text-align: center;
}
.forgot-password-link {
  display: block;
  text-align: right;
  margin-right: 2px;
  margin-bottom: 20px;
  font-size: 14px;
}

/* New: Prompt Positioning Styles */
.prompt-top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 15px;
}
.prompt-below-button {
    text-align: center;
    margin-top: 25px;
    font-size: 15px;
}
.login-prompt a {
    font-weight: bold;
}

.alert.alert-danger.alert-dismissible {
    padding: 10px;
    background-color: rgb(211 154 5);
    margin: 0px 0px 20px 1px;
    border-radius: 2px;
}

.custom-form .form-group, .custom-form .form-group-inline {
    margin-bottom: 0.1rem;
}
.custom-form .form-group-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.custom-form .input-container {
  position: relative;
  margin-bottom: 1.5rem;
}
.custom-form .field-container {
    margin-bottom: 1rem;
}
.custom-form .field-container .input-container {
    margin-bottom: 0;
}
.custom-form .input-container .form-control {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  color: var(--input-text-color);
  background-color: var(--input-bg-color);
  background-image: none;
  border: 1px solid var(--input-border-color);
  border-radius: 5px;
  height: auto;
  box-sizing: border-box;
  transition: border-color 0.3s ease-in-out;
}
.custom-form .input-container .form-control:focus {
  outline: none;
  border-color: #1D4ED8;
}
.custom-form .input-container label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--input-label-color);
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.2s ease-in-out;
  padding: 0 0.25rem;
}

.custom-form .input-container .form-control:focus ~ label,
.custom-form .input-container .form-control:not(:placeholder-shown) ~ label,
.custom-form .input-container .form-control:-webkit-autofill ~ label {
  top: -0.75rem;
  left: 0.75rem;
  font-size: 0.85rem;
  color: var(--input-label-color);
  background-color: var(--input-bg-color);
}

.custom-form .password-wrapper #togglePassword {
  position: absolute;
  top: 37%;
  transform: translateY(-50%);
  right: 15px;
  cursor: pointer;
  color: #666;
  font-size: 18px;
  z-index: 2;
}
.custom-form .input-container input:-webkit-autofill,
.custom-form .input-container input:-webkit-autofill:hover,
.custom-form .input-container input:-webkit-autofill:focus,
.custom-form .input-container input:-webkit-autofill:active {
    box-shadow: 0 0 0 30px var(--input-bg-color) inset !important;
    -webkit-text-fill-color: var(--input-text-color) !important;
}
.password-strength-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  height: 20px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.password-strength-container.visible {
  opacity: 1;
}
.strength-dashes {
  display: flex;
  gap: 4px;
}
.dash {
  height: 4px;
  width: 25px;
  background-color: #e9ecef;
  border-radius: 2px;
  transition: background-color 0.3s;
}
.strength-text {
  font-size: 0.875em;
  transition: color 0.3s;
}
.grecaptcha-error {
  margin-top: 12px;
  border-radius: 5px;
}
.custom-form fieldset {
  border: unset;
  margin-inline: 0px;
  padding-inline: 0px;
  padding-block: 5px 10px;
}
.custom-form legend {
  display: none;
}

body.no-header-body {
  min-height: 100vh;
  justify-content: center;
  position: relative;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  margin: 0px;
}
body.no-header-body .custom-form-container {
  padding: 10px;
  min-height: calc(100vh - 120px); /* Account for Safari UI + mobile header */
  height: auto;
}
body.full-width-layout .custom-form-container {
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh !important;
}
body.full-width-layout .custom-form-wrapper {
  max-width: 100%;
  min-height: 100vh;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  width: 100%;
}
body.full-width-layout .form-image-section,
body.full-width-layout .form-content-section {
  flex-basis: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
body.full-width-layout .form-content-section {
  align-items: center;
}
body.full-width-layout .form-image-section {
  max-width: 40%;
}
body.full-width-layout .custom-form {
  max-width: 50%;
  width: 500px;
}

.social-login-container {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}
.social-login-header {
  text-align: center;
  color: #6c757d;
  margin-bottom: 0.5rem;
  font-size: 16px;
}
.social-buttons-wrapper {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
}
.social-buttons-wrapper a.btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 14px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #fff;
}
.social-buttons-wrapper a.btn-social i {
    margin-right: 8px;
    font-size: 18px;
    line-height: 1;
}
.social-buttons-wrapper a.btn-social .btn-text {
    line-height: 1;
}

.social-buttons-wrapper.style-modern a.btn-social {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    color: #374151;
    padding: 10px;
    border-radius: 8px;
    width: 150px;
    height: 40px;
    font-weight: 500;
    /* flex-direction: column; */
}
.social-buttons-wrapper.style-modern a.btn-social i {
    margin-right: 10px;
    margin-bottom: 2px;
    font-size: 20px;
}

.alert.alert-success.alert-dismissible {
    padding: 10px;
    background: rgb(39, 174, 96);
    border-radius: 5px;
    margin: 0px 0px 12px 0px;
    color: #fff;
}

.social-buttons-wrapper.style-modern a.btn-social .btn-text {
    font-size: 13px;
}
.social-buttons-wrapper.style-modern .btn-google i { color: #DB4437; }
.social-buttons-wrapper.style-modern .btn-facebook i { color: #1877F2; }
.social-buttons-wrapper.style-modern .btn-apple i { color: #000; }
.social-buttons-wrapper.style-modern .btn-twitter i { color: #1DA1F2; }
.social-buttons-wrapper.style-modern .btn-linkedin i { color: #0077B5; }


.social-buttons-wrapper.style-default {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.social-buttons-wrapper.style-default a.btn-social {
    justify-content: center;
    padding: 8px 5px;
    min-width: 0;
    font-size: 12px;
    white-space: nowrap;
}
.social-buttons-wrapper.style-default a.btn-social i {
    margin-right: 5px;
    font-size: 15px;
}
.social-buttons-wrapper.style-default .btn-google { background-color: #4285F4; }
.social-buttons-wrapper.style-default .btn-facebook { background-color: #1877F2; }
.social-buttons-wrapper.style-default .btn-apple { background-color: #000; }
.social-buttons-wrapper.style-default .btn-twitter { background-color: #1DA1F2; }
.social-buttons-wrapper.style-default .btn-linkedin { background-color: #0077B5; }


.social-buttons-wrapper.style-full-width { flex-direction: column; gap: 8px; }
.social-buttons-wrapper.style-full-width a.btn-social { width: 100%; justify-content: center; }
.social-buttons-wrapper.style-full-width .btn-google { background-color: #DB4437; }
.social-buttons-wrapper.style-full-width .btn-facebook { background-color: #3b5998; }
.social-buttons-wrapper.style-full-width .btn-apple { background-color: #000; }
.social-buttons-wrapper.style-full-width .btn-twitter { background-color: #1DA1F2; }
.social-buttons-wrapper.style-full-width .btn-linkedin { background-color: #0077B5; }

.social-buttons-wrapper.style-icon-only a.btn-social { padding: 12px; width: 44px; height: 44px; border-radius: 50%; }
.social-buttons-wrapper.style-icon-only a.btn-social .btn-text { display: none; }
.social-buttons-wrapper.style-icon-only a.btn-social i { margin-right: 0; }
.social-buttons-wrapper.style-icon-only .btn-google { background-color: #4285F4; }
.social-buttons-wrapper.style-icon-only .btn-facebook { background-color: #1877F2; }
.social-buttons-wrapper.style-icon-only .btn-apple { background-color: #000; }
.social-buttons-wrapper.style-icon-only .btn-twitter { background-color: #1DA1F2; }
.social-buttons-wrapper.style-icon-only .btn-linkedin { background-color: #0077B5; }

.social-buttons-wrapper.style-outline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.social-buttons-wrapper.style-outline a.btn-social {
    justify-content: center;
    background-color: transparent;
    padding: 8px 5px;
    min-width: 0;
    font-size: 12px;
    white-space: nowrap;
}
.social-buttons-wrapper.style-outline a.btn-social i {
    margin-right: 5px;
    font-size: 15px;
}
.social-buttons-wrapper.style-outline .btn-google { color: #DB4437; border-color: #DB4437; }
.social-buttons-wrapper.style-outline .btn-facebook { color: #1877F2; border-color: #1877F2; }
.social-buttons-wrapper.style-outline .btn-apple { color: #000; border-color: #000; }
.social-buttons-wrapper.style-outline .btn-twitter { color: #1DA1F2; border-color: #1DA1F2; }
.social-buttons-wrapper.style-outline .btn-linkedin { color: #0077B5; border-color: #0077B5; }

/* MOBILE HEADER STYLES */
.mobile-header-nav {
  display: none;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 15px 20px;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}
.mobile-header-nav .back-link { font-size: 22px; color: #555; }
.mobile-header-nav .signup-area-mobile, .mobile-header-nav .signin-area-mobile {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mobile-header-nav .dont-have-account-text, .mobile-header-nav .already-have-account-text {
    font-size: 14px;
    color: #666;
}
.mobile-header-nav .btn-signup-mobile, .mobile-header-nav .btn-signin-mobile {
  background-color: #eff6ff;
  color: #1d4ed8;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s;
}
.mobile-header-nav .btn-signup-mobile:hover, .mobile-header-nav .btn-signin-mobile:hover { background-color: #dbeafe; color: #1e40af; }

/* Mobile-only utilities and logo alignment */
.mobile-only { display: none; }
.form-logo.align-left { text-align: left; }
.form-logo.align-center { text-align: center; }
.form-logo.align-right { text-align: right; }


/* RESPONSIVE DESIGN & MEDIA QUERIES */
@media (max-width: 991px) {
  .form-image-section { display: none !important; }
  .custom-form .form-group-inline { grid-template-columns: 1fr; gap: 0; }
  .social-login-container { padding-top: 0.5rem; }
  body.full-width-layout .custom-form-wrapper { flex-direction: column; }
  body.full-width-layout .form-content-section { flex-basis: 100%; max-width: 100%; align-items: center; }
  body.full-width-layout .custom-form { max-width: 100%; width: 100%; padding: 10px; margin: 0 0 63px 0;}
}

@media (max-width: 768px) {
  .custom-form-wrapper { flex-direction: column; max-width: 450px; min-height: auto; }
  .form-content-section { padding-top: 60px; padding-bottom: 20px; padding-left: 25px; padding-right: 25px; }
  .custom-form h2 { font-size: 22px; }
  .custom-form h3 { font-size: 15px; margin-bottom: 20px; }
  .social-buttons-wrapper.style-modern a.btn-social { padding: 5; width: 150px; height: 70px; }
  body.no-header-body .mobile-header-nav { display: flex; }
  .image-footer-text, .desktop-login-prompt { display: none; }
  .prompt-top-right { display: none; } /* Hide top-right prompt on mobile */
  .mobile-only { display: block; }
  
  /* Better mobile centering - Fix for iPhone Safari UI */
  .custom-form-container {
    padding: 10px;
    min-height: calc(100vh - 120px); /* Account for Safari UI bars + mobile header (60px + 60px) */
    height: auto;
  }
  
  /* iOS Safari specific viewport fixes */
  @supports (-webkit-touch-callout: none) {
    .custom-form-container {
      min-height: calc(100vh - 140px); /* More conservative for iOS Safari + mobile header */
      height: auto;
    }
  }
}

@media (max-width: 480px) {
  .form-content-section { padding-left: 20px; padding-right: 20px; }
  .social-buttons-wrapper.style-default,
  .social-buttons-wrapper.style-outline { grid-template-columns: 1fr 1fr; }
}

/* iPhone/iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari specific styles - removed problematic transforms */
  body {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  
  .custom-form-container {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
  }
  
  .custom-form-wrapper {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
  }
  
  .form-content-section {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
  }
  
  .custom-form {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
  }
  
  /* Fix for iOS Safari rendering issues */
  .mobile-header-nav {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
  }
  
  /* Reset any unwanted transforms on iOS */
  * {
    -webkit-transform: none !important;
    transform: none !important;
    -webkit-transform-style: flat !important;
    transform-style: flat !important;
    -webkit-perspective: none !important;
    perspective: none !important;
  }
}

/* Additional iOS fixes for orientation and display issues */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
  /* High DPI displays (iPhone, iPad) - removed problematic transforms */
  .custom-form-container {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }
  
  .custom-form-wrapper {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }
}

/* Fix for iPhone orientation changes */
@media screen and (max-width: 768px) and (orientation: portrait) {
  body, body * {
    -webkit-transform: none !important;
    transform: none !important;
    -webkit-perspective: none !important;
    perspective: none !important;
    -webkit-transform-style: flat !important;
    transform-style: flat !important;
    font-style: normal !important;
  }
  
  .custom-form-container {
    -webkit-transform: none !important;
    transform: none !important;
  }
  
  .custom-form-wrapper {
    -webkit-transform: none !important;
    transform: none !important;
  }
}

@media screen and (max-width: 768px) and (orientation: landscape) {
  body, body * {
    -webkit-transform: none !important;
    transform: none !important;
    -webkit-perspective: none !important;
    perspective: none !important;
    -webkit-transform-style: flat !important;
    transform-style: flat !important;
    font-style: normal !important;
  }
  
  .custom-form-container {
    -webkit-transform: none !important;
    transform: none !important;
  }
  
  .custom-form-wrapper {
    -webkit-transform: none !important;
    transform: none !important;
  }
}

/* reCAPTCHA v3 BADGE STYLES - Icon Only on Checkout */
.grecaptcha-badge {
    transition: all 0.4s ease-in-out !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    z-index: 100;
    overflow: hidden;
}

/* Icon Only Badge - Always shows icon only (70px) */
body.recaptcha-badge-bottomleft .grecaptcha-badge,
body.recaptcha-badge-bottomright .grecaptcha-badge { 
    width: 70px !important; 
    height: 60px !important;
    border-radius: 3px !important;
    overflow: hidden !important;
}

body.recaptcha-badge-bottomleft .grecaptcha-badge { left: 0px !important; right: auto !important; }
body.recaptcha-badge-bottomright .grecaptcha-badge { right: 0px !important; left: auto !important; }
body.recaptcha-badge-inline .grecaptcha-badge { visibility: hidden !important; opacity: 0 !important; }

/* Force hide badge text on all pages */
.grecaptcha-badge iframe {
    display: block !important;
    width: 256px !important;
    height: 60px !important;
}
.grecaptcha-badge > div {
    width: 70px !important;
    overflow: hidden !important;
}

/* Force hide badge text on checkout pages */
.checkout-checkout .grecaptcha-badge { 
    width: 70px !important; 
    height: 60px !important;
    overflow: hidden !important;
}
.checkout-checkout .grecaptcha-badge iframe {
    display: block !important;
    width: 256px !important;
    height: 60px !important;
}
.checkout-checkout .grecaptcha-badge > div {
    width: 70px !important;
    overflow: hidden !important;
}

/* Additional iOS Device Specific Fixes */
@media screen and (max-device-width: 768px) {
  /* Target iOS devices specifically */
  body, body *, 
  .custom-form, .custom-form *,
  .form-content-section, .form-content-section *,
  .custom-form-wrapper, .custom-form-wrapper *,
  .custom-form-container, .custom-form-container * {
    -webkit-transform: none !important;
    transform: none !important;
    -webkit-perspective: none !important;
    perspective: none !important;
    -webkit-transform-style: flat !important;
    transform-style: flat !important;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    font-style: normal !important;
    -webkit-text-size-adjust: 100% !important;
    -webkit-font-smoothing: antialiased !important;
    text-rendering: optimizeLegibility !important;
  }
  
  /* Reset font styles specifically */
  h1, h2, h3, h4, h5, h6, p, span, div, a, label, input, button {
    font-style: normal !important;
    -webkit-font-smoothing: antialiased !important;
    -webkit-text-size-adjust: 100% !important;
    text-rendering: optimizeLegibility !important;
  }
}

/* iOS Safari User Agent Detection and Fix */
@supports (-webkit-appearance: none) and (not (overflow: -webkit-marquee)) and (not (-ms-ime-align: auto)) {
  /* This targets iOS Safari specifically */
  * {
    -webkit-transform: none !important;
    transform: none !important;
    -webkit-perspective: none !important;
    perspective: none !important;
    -webkit-transform-style: flat !important;
    transform-style: flat !important;
    font-style: normal !important;
  }
  
  body {
    -webkit-text-size-adjust: 100% !important;
    -webkit-font-smoothing: antialiased !important;
  }
}

/* Force normal font style on all text elements for iOS */
@media screen and (-webkit-min-device-pixel-ratio: 1) {
  /* iOS devices */
  body, h1, h2, h3, h4, h5, h6, p, span, div, a, label, input, button, 
  .custom-form, .custom-form *, 
  .form-content-section, .form-content-section *,
  .mobile-header-nav, .mobile-header-nav * {
    font-style: normal !important;
    font-variation-settings: 'slnt' 0 !important;
    -webkit-font-smoothing: antialiased !important;
    -webkit-text-size-adjust: 100% !important;
    text-rendering: optimizeLegibility !important;
    -webkit-transform: none !important;
    transform: none !important;
  }
}

/* Universal mobile fix for all devices */
@media screen and (max-width: 768px) {
  /* All mobile devices */
  *, *::before, *::after {
    font-style: normal !important;
    font-variation-settings: 'slnt' 0 !important;
    -webkit-font-feature-settings: normal !important;
    font-feature-settings: normal !important;
    -webkit-transform: none !important;
    transform: none !important;
  }
  
  body, .custom-form {
    font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
  }
}
