/* Scoped OTP dialog styles; existing page form styles remain unchanged. */
#email-verification-dialog {
  box-sizing: border-box;
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: #253348;
  box-shadow: 0 24px 64px rgba(12, 42, 75, .28), 0 2px 8px rgba(12, 42, 75, .12);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow: auto;
}
#email-verification-dialog[open] { animation: drone-otp-in .2s ease-out; }
#email-verification-dialog::backdrop { background: rgba(10, 30, 52, .56); }
#email-verification-dialog *, #email-verification-dialog *::before, #email-verification-dialog *::after { box-sizing: border-box; }
#email-verification-dialog .ev-inner { padding: 28px 28px 24px; }
#email-verification-dialog .ev-icon {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin: 0 0 14px; border-radius: 50%;
  background: #eaf5fb; color: #166792;
}
#email-verification-dialog .ev-icon svg { width: 26px; height: 26px; }
#email-verification-dialog h2 { margin: 0 0 8px; padding: 0; border: 0; color: #17324d; font-size: 20px; font-weight: 700; line-height: 1.45; letter-spacing: .02em; }
#email-verification-dialog .ev-note { margin: 0 0 22px; color: #46576b; font-size: 15px; line-height: 1.8; }
#email-verification-dialog .ev-label { display: block; margin: 0 0 8px; color: #33465c; font-size: 14px; font-weight: 700; line-height: 1.5; }
#email-verification-dialog .ev-code {
  display: block; width: 100%; height: 64px; margin: 0; padding: 0 12px 0 calc(12px + .42em);
  border: 2px solid #c8d4df; border-radius: 13px; background: #f8fafc; color: #102235;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Roboto Mono", monospace;
  font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: .42em; text-align: center;
  font-variant-numeric: tabular-nums; box-shadow: none; outline: none; appearance: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
#email-verification-dialog .ev-code:focus { border-color: #1674a5; background: #fff; box-shadow: 0 0 0 4px rgba(22, 116, 165, .2); }
#email-verification-dialog .ev-code[aria-invalid="true"] { border-color: #c9362b; background: #fff; box-shadow: 0 0 0 4px rgba(201, 54, 43, .13); }
#email-verification-dialog .ev-status { margin: 12px 0 0; color: #46576b; font-size: 14px; line-height: 1.7; }
#email-verification-dialog .ev-status:empty { display: none; }
#email-verification-dialog .ev-status.is-busy { display: flex; align-items: center; gap: 8px; color: #1674a5; font-weight: 600; }
#email-verification-dialog .ev-status.is-busy::before { content: ""; flex: none; width: 16px; height: 16px; border: 2px solid rgba(22, 116, 165, .24); border-top-color: #1674a5; border-radius: 50%; animation: drone-otp-spin .8s linear infinite; }
#email-verification-dialog .ev-status.is-error { padding: 10px 14px; border-left: 4px solid #c9362b; border-radius: 9px; background: #fff0ee; color: #9d281f; font-weight: 600; }
#email-verification-dialog .ev-status.is-success { padding: 10px 14px; border-left: 4px solid #188249; border-radius: 9px; background: #eaf7ef; color: #146b3c; font-weight: 700; }
#email-verification-dialog .ev-actions { display: flex; flex-direction: row-reverse; gap: 10px; margin: 22px 0 0; }
#email-verification-dialog .ev-btn { display: inline-flex; flex: 1 1 0; align-items: center; justify-content: center; min-height: 52px; margin: 0; padding: 12px 18px; border-radius: 11px; font: 700 16px/1.3 inherit; cursor: pointer; }
#email-verification-dialog .ev-btn:focus-visible, #email-verification-dialog .ev-resend:focus-visible { outline: 3px solid #1674a5; outline-offset: 2px; }
#email-verification-dialog .ev-btn:disabled, #email-verification-dialog .ev-resend:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
#email-verification-dialog .ev-btn--primary { border: 2px solid #1674a5; background: #1674a5; color: #fff; box-shadow: 0 4px 12px rgba(22, 116, 165, .25); }
#email-verification-dialog .ev-btn--primary:hover:not(:disabled) { border-color: #105c84; background: #105c84; }
#email-verification-dialog .ev-btn--secondary { border: 2px solid #cbd5df; background: #fff; color: #33465c; }
#email-verification-dialog .ev-btn--secondary:hover:not(:disabled) { background: #f1f5f8; }
#email-verification-dialog .ev-resend { display: block; min-height: 44px; margin: 12px auto 0; padding: 8px 14px; border: 0; border-radius: 8px; background: none; color: #166f9e; font: 600 14px/1.5 inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#email-verification-dialog .ev-resend:hover:not(:disabled) { background: #eef7fb; color: #105c84; }

.otp-recovery-panel { max-width: 680px; margin: 24px auto; padding: 24px; border: 1px solid #cddbe7; border-radius: 14px; background: #f7fbfe; color: #253348; }
.otp-recovery-panel h1 { margin: 0 0 10px; color: #17324d; font-size: 22px; line-height: 1.5; }
.otp-recovery-panel p { margin: 8px 0; line-height: 1.8; }
.otp-recovery-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.otp-recovery-actions button { min-height: 48px; padding: 10px 20px; border: 2px solid #1674a5; border-radius: 10px; background: #1674a5; color: #fff; font: 700 16px/1.4 inherit; cursor: pointer; }
.otp-recovery-actions button.otp-recovery-secondary { background: #fff; color: #166f9e; }
.otp-recovery-actions button:disabled { opacity: .55; cursor: not-allowed; }
.otp-recovery-status { margin-top: 14px; color: #166f9e; font-weight: 600; }
.otp-recovery-status.is-error { color: #9d281f; }

@media (max-width: 479px) {
  #email-verification-dialog { width: calc(100% - 20px); max-height: calc(100% - 20px); border-radius: 14px; }
  #email-verification-dialog .ev-inner { padding: 22px 18px 18px; }
  #email-verification-dialog .ev-code { height: 60px; font-size: 26px; }
  #email-verification-dialog .ev-actions { flex-direction: column; }
  .otp-recovery-panel { margin: 14px 10px; padding: 20px 16px; }
  .otp-recovery-actions, .otp-recovery-actions button { width: 100%; }
}
@keyframes drone-otp-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes drone-otp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #email-verification-dialog[open] { animation: none; } #email-verification-dialog .ev-status.is-busy::before { animation-duration: 2.4s; } }

/* Keep inline email controls in the form rather than a floating dialog. */
.otp-ui.otp-inline:is(#email-verification-dialog, .otp-ui) {
 width:100%; max-width:none; max-height:none; overflow:visible;
 margin:12px 0 0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none;
}
.otp-ui.otp-inline:is(#email-verification-dialog, .otp-ui) .otp-inner { padding:0; }
.otp-ui.otp-inline:is(#email-verification-dialog, .otp-ui) .otp-actions { display:flex; flex-wrap:wrap; gap:8px; }
.otp-ui.otp-inline:is(#email-verification-dialog, .otp-ui) .otp-primary { width:auto; min-height:48px; padding:11px 20px; }
.otp-ui.otp-inline:is(#email-verification-dialog, .otp-ui) .otp-help { margin:8px 0 0; padding:0; border:0; font-size:14px; }
.otp-ui.otp-inline:is(#email-verification-dialog, .otp-ui) .otp-status[hidden] { display:none; }
@media (max-width:420px) {
 .otp-ui.otp-inline:is(#email-verification-dialog, .otp-ui) .otp-primary { width:100%; }
}
