/* ==========================================================================
   OTP Login Popup Checkout - Widget Styles (Main Entry Point)
   ==========================================================================
   Plain CSS, no custom properties - every value is written directly so
   any value can be changed in place without hunting for a variable
   definition elsewhere. Every class name is prefixed "otp-login-" to
   avoid clashing with Journal 3's own classes.

   Sections:
     1. Hide Journal's stock login/register wells
     2. Card shell
     3. Header
     4. Tabs
     5. Form fields (email input, labels, error text)
     6. OTP digit boxes + resend row
     7. Submit button
     8. Phone tab (UI only)
     9. Social login row (UI only)
     10. Success message
     11. Animations
     12. Small screen adjustments
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Hide Journal 3's stock login/register wells
   Journal's "New Customer" and "Returning Customer" wells are redundant
   once this widget is in place. The widget itself is inserted inside the
   same .login-box row by the OCMod template patch, so this rule must
   specifically keep the widget's own wrapper visible while hiding
   everything else in that row.
   -------------------------------------------------------------------------- */
.login-box > .col-sm-6:not(:has(.otp-login-widget)) {
  display: none !important;
}

.login-box > .col-sm-6:has(.otp-login-widget) > .well {
  padding: 0;
  border: none;
  background: transparent;
}

.login-box > .col-sm-6:has(.otp-login-widget) > .well > *:not(.otp-login-widget) {
  display: none !important;
}


/* --------------------------------------------------------------------------
   2. Card shell
   -------------------------------------------------------------------------- */
.otp-login-widget {
  width:100%;
}

.otp-login-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-right:20px;
 padding:50px 30px; 
box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
  margin-left:20px;
  color: #111827;
}

.otp-login-card *,
.otp-login-card *::before,
.otp-login-card *::after {
  box-sizing: border-box;
}


/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */
.otp-login-header {
  margin-bottom: 24px;
}

.otp-login-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.otp-login-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin: 4px 0 0;
}


/* --------------------------------------------------------------------------
   4. Tabs
   -------------------------------------------------------------------------- */
.otp-login-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
}

.otp-login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.otp-login-tab-active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* --------------------------------------------------------------------------
   5. Form fields
   -------------------------------------------------------------------------- */
.otp-login-panel {
  display: none;
}

.otp-login-panel-active {
  display: block;
  animation: otp-login-fade-in 260ms ease;
}

.otp-login-field {
  position: relative !important;
  margin-top: 18px !important;
  margin-bottom: 22px !important;
  clear: both !important;
  display: block !important;
}

.otp-login-field.has-error {
  margin-bottom: 26px !important;
}

.otp-login-label {
  position: absolute !important;
  top: -8px !important;
  left: 10px !important;
  display: inline-block !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #17212B !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
  margin: 0 !important;
  padding: 0px 8px !important;
  background: #FFFFFF !important;
  border-radius: 4px !important;
  line-height: 1.2 !important;
  pointer-events: none !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  z-index: 10 !important;
  max-width: calc(100% - 20px) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.otp-login-field.is-empty:not(.is-focused):not(:focus-within) > .otp-login-label {
  top: 13px !important;
  left: 14px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #64748B !important;
  text-transform: capitalize !important;
  letter-spacing: 0px !important;
  background: transparent !important;
  padding: 0 4px !important;
  z-index: 2 !important;
}

.otp-login-field:has(.otp-login-phone-row) > .otp-login-label {
  top: -8px !important;
  left: 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #17212B !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
  margin: 0 !important;
  padding: 0px 8px !important;
  background: #FFFFFF !important;
  line-height: 1.2 !important;
  z-index: 10 !important;
}

.otp-login-field.is-focused > .otp-login-label,
.otp-login-field:focus-within > .otp-login-label {
  color: #0B72A4 !important;
}

.otp-login-input {
  width: 100%;
  height: 46px !important;
  min-height: 46px !important;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #17212B;
  background: #ffffff;
  border: 1.5px solid #DCE7EB;
  border-radius: 10px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.otp-login-input:focus {
  border-color: #0B72A4;
  box-shadow: 0 0 0 3px rgba(11, 114, 164, 0.14);
}

.otp-login-input.otp-login-input-invalid {
  border-color: #d70015;
}

.otp-login-input:read-only {
  background: #f3f4f6;
  color: #6b7280;
  cursor: default;
}

.otp-login-input:read-only:focus {
  box-shadow: none;
}

/* Email field + "Change" link, side by side */
.otp-login-email-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.otp-login-email-row .otp-login-input {
  flex: 1;
}

.otp-login-change-email {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #000000;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  transition: opacity 160ms ease;
}

.otp-login-change-email:hover {
  opacity: 0.7;
}

.otp-login-error {
  min-height: 18px;
  font-size: 13px;
  color: #d70015;
  margin: -2px 0 10px;
}


/* --------------------------------------------------------------------------
   6. OTP digit boxes + resend row
   -------------------------------------------------------------------------- */
.otp-login-otp-block {
  margin-top: 10px;
  margin-bottom: 16px;
}

.otp-login-sent-message {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 10px;
  line-height: 1.4;
}

.otp-login-otp-digits {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.otp-login-otp-digit,
.otp-login-whatsapp-otp-digit {
  width: 100%;
  aspect-ratio: 1 / 1;
  text-align: center;
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 100ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.otp-login-otp-digit:focus,
.otp-login-whatsapp-otp-digit:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
  transform: scale(1.04);
}

.otp-login-otp-digit.otp-login-otp-digit-filled,
.otp-login-whatsapp-otp-digit.otp-login-otp-digit-filled {
  border-color: #000000;
}

.otp-login-otp-digit.otp-login-otp-digit-invalid,
.otp-login-whatsapp-otp-digit.otp-login-otp-digit-invalid {
  border-color: #d70015;
  animation: otp-login-shake 320ms ease;
}

.otp-login-resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
  font-size: 13px;
}

.otp-login-resend-button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #000000;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.otp-login-resend-button:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

.otp-login-resend-timer {
  color: #6b7280;
}


/* --------------------------------------------------------------------------
   7. Submit button
   -------------------------------------------------------------------------- */
.otp-login-submit-button {
  width: 100%;
  padding: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: #1A375B;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, opacity 160ms ease, transform 80ms ease;
  margin-bottom: 24px;
}

.otp-login-submit-button:hover {
  background:#23446d;
}

.otp-login-submit-button:active {
  transform: scale(0.98);
}

.otp-login-submit-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.otp-login-submit-spinner {
  display: none;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: otp-login-spin 700ms linear infinite;
}

.otp-login-submit-button-loading .otp-login-submit-spinner {
  display: inline-block;
}


/* --------------------------------------------------------------------------
   8. Phone tab (WhatsApp OTP when enabled, disabled placeholder otherwise)
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   8. Phone tab (Unified Input Box: Country Prefix | Number)
   -------------------------------------------------------------------------- */
.otp-phone-unified-box,
.otp-login-phone-row {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  background: #FFFFFF !important;
  border: 1.5px solid #DCE7EB !important;
  border-radius: 10px !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  cursor: text !important;
  pointer-events: auto !important;
  z-index: 1 !important;
}

.otp-phone-unified-box:hover,
.otp-login-phone-row:hover {
  border-color: #C3D7DF !important;
}

.otp-phone-unified-box:focus-within,
.otp-login-phone-row:focus-within {
  border-color: #0B72A4 !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 3px rgba(11, 114, 164, 0.14) !important;
}

.otp-login-country-prefix {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  height: 100% !important;
  min-height: 44px !important;
  padding: 0 8px 0 12px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #17212B !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  pointer-events: auto !important;
  user-select: none !important;
}

.otp-login-country-flag {
  display: none !important;
}

.otp-dropdown-arrow-icon {
  font-size: 10px !important;
  color: #64748B !important;
  line-height: 1 !important;
  pointer-events: none !important;
}

.otp-country-code-text {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #17212B !important;
  pointer-events: none !important;
}

.otp-phone-divider {
  width: 1px !important;
  height: 22px !important;
  background: #DCE7EB !important;
  flex: 0 0 1px !important;
  margin: 0 4px !important;
  pointer-events: none !important;
}

.otp-phone-unified-box .otp-login-input,
.otp-phone-unified-box .otp-phone-number-input,
.otp-login-phone-row .otp-login-input {
  display: block !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 44px !important;
  max-height: 46px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 12px !important;
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #17212B !important;
  box-sizing: border-box !important;
  line-height: 44px !important;
  cursor: text !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 2 !important;
}

.otp-phone-unified-box input[type="tel"]::placeholder,
.otp-login-phone-row input[type="tel"]::placeholder {
  color: #94A3B8 !important;
  opacity: 0.8 !important;
  display: block !important;
  font-size: 13.5px !important;
}
  box-sizing: border-box !important;
  line-height: 42px !important;
}

.otp-phone-unified-box .otp-login-input:focus,
.otp-login-phone-row .otp-login-input:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}

.otp-login-coming-soon-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748B;
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}


/* --------------------------------------------------------------------------
   9. Social login row (UI only)
   -------------------------------------------------------------------------- */
.otp-login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}

.otp-login-divider::before,
.otp-login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}

.otp-login-divider span {
  padding: 0 10px;
}

.otp-login-social-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.otp-login-social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease;
}

.otp-login-social-button:hover {
  background: #f3f4f6;
}

.otp-login-social-button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   10. Success message
   -------------------------------------------------------------------------- */
.otp-login-success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.otp-login-success-circle {
  stroke: #16a34a;
  stroke-width: 2;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: otp-login-draw-circle 450ms ease forwards;
}

.otp-login-success-check {
  stroke: #16a34a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: otp-login-draw-check 300ms 400ms ease forwards;
}

.otp-login-success-message {
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 24px;
}


/* --------------------------------------------------------------------------
   11. Animations
   -------------------------------------------------------------------------- */
@keyframes otp-login-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes otp-login-spin {
  to { transform: rotate(360deg); }
}

@keyframes otp-login-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

@keyframes otp-login-draw-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes otp-login-draw-check {
  to { stroke-dashoffset: 0; }
}


/* --------------------------------------------------------------------------
   12. Small screen adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 479px) {
  .otp-login-widget {
    max-width: 100%;
  }

  .otp-login-card {
 padding:50px 20px; 
box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
    
  }

  .otp-login-otp-digit {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .otp-login-panel-active,
  .otp-login-otp-digit,
  .otp-login-submit-button {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
