/**
 * Frontend OTP forms & modal.
 */

.adev-otp-form {
  max-width: 360px;
  margin: 0 auto;
  font-family: inherit;
}

.adev-otp-form__label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.adev-otp-form__input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
}

.adev-otp-form__input:focus {
  outline: 2px solid #1a5f4a;
  outline-offset: 1px;
  border-color: #1a5f4a;
}

.adev-otp-form__btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--adev-otp-btn-bg, #1a5f4a);
  color: var(--adev-otp-btn-text, #fff);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.adev-otp-form__btn:hover {
  filter: brightness(0.92);
}

.adev-otp-form__btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.adev-otp-form__link {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.4rem;
  border: 0;
  background: transparent;
  color: #1a5f4a;
  cursor: pointer;
  text-decoration: underline;
}

.adev-otp-form__link:disabled {
  color: #888;
  text-decoration: none;
  cursor: default;
}

.adev-otp-form__msg {
  margin-top: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.adev-otp-form__msg.is-ok {
  background: #edfaef;
  color: #1e6b2f;
}

.adev-otp-form__msg.is-err {
  background: #fcf0f1;
  color: #8a1f1b;
}

.adev-otp-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Modal */
.adev-otp-modal[hidden] {
  display: none !important;
}

.adev-otp-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.adev-otp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 20, 0.55);
}

.adev-otp-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.adev-otp-modal__close {
  position: absolute;
  top: 0.5rem;
  left: 0.65rem;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #555;
}

.adev-otp-modal__tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

.adev-otp-modal__tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  color: #666;
  border-radius: 6px 6px 0 0;
}

.adev-otp-modal__tab.is-active {
  color: #1a5f4a;
  box-shadow: inset 0 -2px 0 #1a5f4a;
}

/* Inline tabs (My Account / shortcode) */
.adev-otp-tabs {
  width: 100%;
}

.adev-otp-tabs__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
  padding: 0.35rem;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #f6f7f8;
}

.adev-otp-tabs__tab {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
  color: #8a8c8e;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.adev-otp-tabs__tab:hover {
  color: #0aa74b;
  background: #fff;
}

.adev-otp-tabs__tab.is-active {
  color: #fff !important;
  background: #0aa74b !important;
  border-color: #0aa74b !important;
  box-shadow: 0 2px 8px rgba(10, 167, 75, 0.28);
}

.adev-otp-tabs__hint {
  margin: 0 0 0.75rem;
  color: #8a8c8e;
  font-size: 0.9rem;
  line-height: 1.6;
}

.adev-otp-tabs__panel .adev-otp-form {
  margin: 0;
  max-width: none;
}

.adev-otp-wc-account {
  margin-bottom: 1.5rem;
}

.adev-otp-wc-account > h2 {
  margin-bottom: 1rem;
}

.adev-otp-open-modal {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--adev-otp-btn-bg, #1a5f4a);
  color: var(--adev-otp-btn-text, #fff);
  font-weight: 700;
  cursor: pointer;
}

.adev-otp-checkout {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px dashed #cfcfcf;
  border-radius: 8px;
}

.adev-otp-checkout-login {
  max-width: 420px;
  margin: 1.5rem auto 2rem;
  padding: 1.5rem 1.25rem;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
}

.adev-otp-checkout-login__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
}

.adev-otp-checkout-login__desc {
  margin: 0 0 1.25rem;
  color: #8a8c8e;
  font-size: 0.9rem;
  line-height: 1.7;
  text-align: center;
}

.adev-otp-checkout-login .adev-otp-tabs {
  max-width: none;
}

.adev-otp-wp-login {
  max-width: 360px;
  margin: 1rem auto;
}

.adev-otp-switch {
  text-align: center;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .adev-otp-modal__dialog {
    padding: 1rem;
  }
}
