/**
 * YensBaby Auth, Registration & Email OTP Styling — Phase 6.1 Authoritative System
 */

/* Modal Backdrop & Overlay */
.yens-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 16px;
  box-sizing: border-box;
}

.yens-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modal Card Sizing & Scrollable Body */
.yens-auth-modal-card {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.yens-auth-tabs {
  display: flex;
  background-color: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  position: relative;
  flex-shrink: 0;
}

.yens-auth-tab-btn {
  flex: 1;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748B;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.yens-auth-tab-btn.is-active {
  color: #0984E3;
  border-bottom-color: #0984E3;
  background-color: #FFFFFF;
}

.yens-modal-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.yens-modal-close:hover {
  color: #1E293B;
}

.yens-auth-form-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  box-sizing: border-box;
}

/* Form Group & Label Spacing */
.yens-form-group {
  margin-bottom: 18px;
  text-align: left;
}

.yens-form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.yens-form-label .required {
  color: #EF4444;
}

/* Input Fields Consistency */
.yens-input {
  width: 100%;
  height: 46px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  background-color: #FFFFFF;
  font-size: 0.95rem;
  color: #1E293B;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.yens-input:focus {
  border-color: #0984E3;
  box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.15);
}

/* Remember Me & Forgot Password Row Alignment */
.yens-auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 22px 0;
  font-size: 0.88rem;
  color: #475569;
}

.yens-auth-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}

.yens-auth-options input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0984E3;
  cursor: pointer;
  margin: 0;
}

.yens-auth-options a {
  color: #0984E3;
  font-weight: 600;
  text-decoration: none;
}

.yens-auth-options a:hover {
  text-decoration: underline;
}

/* AUTHORITATIVE PRIMARY CTA BUTTON STYLING */
.yens-auth-modal-card .yens-btn-primary,
.yens-auth-modal-card button[name="login"],
.woocommerce-form-login button.button,
.yens-submit-reg-btn,
.yens-verify-otp-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 20px !important;
  background-color: #0984E3 !important;
  color: #FFFFFF !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  border: none !important;
  border-radius: 8px !important;
  outline: none !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: 0 2px 6px rgba(9, 132, 227, 0.2) !important;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease !important;
  margin-top: 8px !important;
}

.yens-auth-modal-card .yens-btn-primary:hover,
.yens-auth-modal-card button[name="login"]:hover,
.woocommerce-form-login button.button:hover,
.yens-submit-reg-btn:hover,
.yens-verify-otp-btn:hover {
  background-color: #0773C5 !important;
  box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3) !important;
}

.yens-auth-modal-card .yens-btn-primary:active,
.yens-auth-modal-card button[name="login"]:active {
  transform: translateY(1px) !important;
}

/* Password Toggle Eye Button */
.yens-password-wrap {
  position: relative;
}

.yens-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none !important;
  border: none !important;
  color: #64748B !important;
  cursor: pointer !important;
  font-size: 1rem !important;
  padding: 6px !important;
  line-height: 1 !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: 0 !important;
  width: auto !important;
}

/* Registration Form Grid inside Modal */
.yens-form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .yens-form-row-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.yens-phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  overflow: hidden;
  background-color: #FFFFFF;
}

.yens-phone-input-wrap:focus-within {
  border-color: #0984E3;
  box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.15);
}

.yens-country-flag-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 44px;
  background-color: #F1F5F9;
  border-right: 1px solid #CBD5E1;
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  user-select: none;
}

.yens-phone-input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
}

.yens-field-helper {
  display: block;
  font-size: 0.78rem;
  color: #64748B;
  margin-top: 4px;
}

.yens-radio-group {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}

.yens-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
}

.yens-radio-input {
  accent-color: #0984E3;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.yens-divider-dashed {
  border: none;
  border-top: 1px dashed #CBD5E1;
  margin: 20px 0;
}

/* OTP Verification Styling inside Modal */
.yens-otp-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #EBF5FF;
  color: #0984E3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 12px auto;
}

.yens-masked-email-badge {
  display: inline-block;
  background-color: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0F172A;
  margin-top: 6px;
}

.yens-otp-box-wrap {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 20px 0;
}

.yens-otp-digit {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  border: 2px solid #CBD5E1;
  border-radius: 8px;
  background-color: #FFFFFF;
  color: #0984E3;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.yens-otp-digit:focus {
  border-color: #0984E3;
  box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.2);
}

.yens-resend-wrap {
  margin-top: 16px;
}

.yens-resend-text {
  font-size: 0.85rem;
  color: #64748B;
  margin-bottom: 2px;
}

.yens-btn-link {
  background: none !important;
  border: none !important;
  color: #0984E3 !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.yens-btn-link:disabled {
  color: #94A3B8 !important;
  cursor: not-allowed !important;
}

/* Mobile Responsiveness */
@media (max-width: 520px) {
  .yens-auth-modal-card {
    max-height: 94vh;
    border-radius: 12px;
  }
  .yens-auth-form-wrap {
    padding: 18px 16px;
  }
  .yens-auth-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 0 18px 0;
  }
  .yens-otp-digit {
    width: 38px;
    height: 48px;
    font-size: 1.2rem;
  }
}
