/* ============================================================
   Magic OTP Login Plugin — User Styles
   Clean card design — white card on gray background
   ============================================================ */

/* ── Page wrapper (full-width gray bg, breaks out of theme container) ── */
.motp-page {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  background: #f0f0f0;
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 64px;
  box-sizing: border-box;
}

/* ── Card container ─────────────────────────────────────── */
.motp-wrap {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 18px;
  padding: 44px 44px 40px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #111;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.07);
}

/* ── Start page: title & subtitle ───────────────────────── */
.motp-start-title {
  font-size: 26px;
  font-weight: 700;
  color: #111;
  margin: 0 0 10px;
  line-height: 1.25;
}

.motp-start-sub {
  font-size: 16px;
  color: #555;
  line-height: 1.55;
  margin: 0 0 30px;
}

/* ── Wait page: lead text (subtitle with masked email) ───── */
.motp-lead {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: #666;
  margin: 0 0 10px;
}

.motp-lead strong {
  font-weight: 600;
  color: #333;
}

/* ── "Didn't receive" paragraph ─────────────────────────── */
.motp-no-code {
  margin: 0 0 30px;
  font-size: 15px;
}

.motp-no-code a {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.motp-no-code a:hover {
  color: #555;
}

/* ── Form ───────────────────────────────────────────────── */
.motp-form {
  display: flex;
  flex-direction: column;
}

.motp-field {
  margin-bottom: 12px;
}

.motp-label,
.motp-start-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #111;
  margin-bottom: 7px;
}

/* ── Email input (start page) ───────────────────────────── */
.motp-start-input {
  width: 100%;
  padding: 13px 15px;
  font-size: 16px;
  color: #111;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  box-sizing: border-box;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.motp-start-input:focus {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* ── Single OTP input (wait page) ───────────────────────── */
.motp-otp-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 10px;
  color: #111;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  box-sizing: border-box;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
  -moz-appearance: textfield;
}

.motp-otp-input:focus {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.motp-otp-input::placeholder {
  color: #ccc;
  letter-spacing: 4px;
}

.motp-otp-input::-webkit-outer-spin-button,
.motp-otp-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

/* ── Resend row ─────────────────────────────────────────── */
.motp-resend-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 24px;
  font-size: 14px;
  flex-wrap: wrap;
}

.motp-resend-link {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  white-space: nowrap;
}

.motp-resend-link:hover {
  color: #555;
}

.motp-countdown {
  color: #999;
  font-size: 13px;
  white-space: nowrap;
}

.motp-link-disabled {
  color: #bbb !important;
  pointer-events: none;
  cursor: default;
  text-decoration: none !important;
}

.motp-text-muted {
  color: #999;
  font-size: 13px;
}

/* ── Remember me row ────────────────────────────────────── */
.motp-remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  position: relative;
}

.motp-remember-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex: 1;
}

/* Custom checkbox */
.motp-checkbox-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.motp-checkbox-wrap input[type="checkbox"] {
  width: 22px;
  height: 22px;
  opacity: 0;
  position: absolute;
  cursor: pointer;
  margin: 0;
}

.motp-checkmark {
  width: 22px;
  height: 22px;
  border: 1.5px solid #d8d8d8;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.motp-checkbox-wrap input[type="checkbox"]:checked + .motp-checkmark {
  background: #111;
  border-color: #111;
}

.motp-checkbox-wrap input[type="checkbox"]:checked + .motp-checkmark::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.motp-checkbox-wrap input[type="checkbox"]:focus + .motp-checkmark {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.motp-remember-text {
  font-size: 15px;
  color: #111;
  line-height: 1.4;
}

/* Info button */
.motp-info-btn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: #aaa;
  display: inline-flex;
  align-items: center;
  border-radius: 50%;
  transition: color 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

.motp-info-btn:hover,
.motp-info-btn:focus {
  color: #555;
  outline: none;
}

/* Tooltip */
.motp-tooltip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  width: 300px;
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  padding: 14px 16px;
  border-radius: 10px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.motp-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 26px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #1a1a1a;
}

.motp-tooltip-open {
  display: block;
}

/* ── Submit button (pill) ───────────────────────────────── */
.motp-btn-submit {
  width: 100%;
  padding: 16px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: background 0.15s, transform 0.1s;
  margin-top: 6px;
  margin-bottom: 0;
}

.motp-btn-submit:hover:not(:disabled) {
  background: #333;
}

.motp-btn-submit:active:not(:disabled) {
  transform: scale(0.99);
}

.motp-btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Magic link note ────────────────────────────────────── */
.motp-magic-note {
  font-size: 13px;
  color: #999;
  line-height: 1.6;
  margin: 20px 0 0;
}

.motp-magic-note strong {
  color: #777;
  font-weight: 600;
}

/* ── Back link ──────────────────────────────────────────── */
.motp-back {
  margin-top: 22px;
  font-size: 15px;
  text-align: center;
}

.motp-back a {
  color: #2563eb;
  text-decoration: none;
}

.motp-back a:hover {
  text-decoration: underline;
}

/* ── Login button (for hooks into standard login form) ──── */
.motp-login-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  background: #f6f6f6;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  color: #222;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  margin: 8px 0;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.motp-login-button:hover {
  background: #ececec;
  border-color: #c5c5c5;
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 540px) {
  .motp-page {
    padding: 24px 12px 48px;
  }

  .motp-wrap {
    padding: 32px 24px 28px;
    border-radius: 14px;
  }

  .motp-start-title {
    font-size: 22px;
  }

  .motp-lead {
    font-size: 18px;
  }

  .motp-otp-input {
    font-size: 24px;
    letter-spacing: 7px;
  }

  .motp-tooltip {
    width: 240px;
  }
}
