/* Styles only the elements the plugin injects.
   Your site's own input/label/button styles are kept untouched. */

/* While a submission is in flight: progress cursor + non-interactive feel.
   Keyboard input is still allowed (browsers ignore pointer-events for keys),
   so the JS-level guard is what actually prevents duplicate submissions. */
.dwss-form--busy { cursor: progress; }
.dwss-form--busy [type="submit"] { cursor: progress; opacity: 0.75; }


.dwss-message {
    padding: 12px 16px;
    margin: 0 0 18px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}
.dwss-message--success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.dwss-message--error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; font-weight: 500; }
.dwss-message--info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* Per-field error message — appears next to the invalid input. */
.dwss-field-error {
    display: block;
    color: #b91c1c;
    background: #fef2f2;
    border-left: 3px solid #dc2626;
    padding: 6px 10px;
    margin-top: 6px;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    animation: dwss-shake 0.25s ease-in-out;
}

/* Red border + soft glow on the invalid input. */
.dwss-error,
.dwss-error:focus {
    border-color: #dc2626 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14) !important;
    outline: none !important;
}

@keyframes dwss-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-3px); }
    75%      { transform: translateX(3px); }
}

/* OTP verification modal.
   The modal lives at the end of <body> and is reused across every form
   on the page. Hidden by default; visible when .dwss-otp-modal--visible
   is added. Independent of the host form's layout — works on top of any
   page styles. */

.dwss-otp-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.dwss-otp-modal--visible { display: flex; }

.dwss-otp-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: dwss-fade-in 0.18s ease-out;
}

.dwss-otp-modal__card {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 28px 28px 22px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
    animation: dwss-otp-pop 0.22s cubic-bezier(.2,.9,.3,1);
}

.dwss-otp-modal__heading {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.2px;
}
.dwss-otp-modal__subtext {
    margin: 0 0 20px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.dwss-otp-modal__input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 8px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #0f172a;
    font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.dwss-otp-modal__input::placeholder { color: #cbd5e1; letter-spacing: 8px; }
.dwss-otp-modal__input:focus {
    outline: none;
    border-color: #3498db;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.18);
}
.dwss-otp-modal__input--error {
    border-color: #dc2626;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
    animation: dwss-shake 0.25s ease-in-out;
}

.dwss-otp-modal__error {
    display: none;
    margin: 10px 0 0;
    font-size: 13px;
    color: #b91c1c;
    font-weight: 500;
    line-height: 1.4;
}

.dwss-otp-modal__resend {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}
.dwss-otp-modal__resend-text { color: #64748b; }
.dwss-otp-modal__resend-btn {
    background: none;
    border: 0;
    padding: 0 2px;
    margin: 0;
    font: inherit;
    font-weight: 600;
    color: #94a3b8;
    cursor: not-allowed;
}
.dwss-otp-modal__resend-btn:not(:disabled) {
    color: #3498db;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.dwss-otp-modal__resend-btn:not(:disabled):hover { color: #2683c0; }

.dwss-otp-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    justify-content: flex-end;
}

.dwss-otp-modal__cancel,
.dwss-otp-modal__verify {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    transition: background .15s, border-color .15s, color .15s;
}
.dwss-otp-modal__cancel {
    background: transparent;
    color: #475569;
    border-color: #e2e8f0;
}
.dwss-otp-modal__cancel:hover { background: #f8fafc; color: #0f172a; }
.dwss-otp-modal__verify {
    background: #3498db;
    color: #ffffff;
}
.dwss-otp-modal__verify:hover:not(:disabled) { background: #2683c0; }
.dwss-otp-modal__verify:disabled { opacity: 0.6; cursor: not-allowed; }

@keyframes dwss-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes dwss-otp-pop {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@media (max-width: 480px) {
    .dwss-otp-modal__card { padding: 22px 20px 18px; }
    .dwss-otp-modal__input { font-size: 20px; letter-spacing: 6px; padding: 12px; }
    .dwss-otp-modal__actions { flex-direction: column-reverse; }
    .dwss-otp-modal__cancel,
    .dwss-otp-modal__verify { width: 100%; }
}
