/* Copy of Twilio OTP CSS */
* {
    box-sizing: border-box;
}

/* Main OTP Wrapper */
.twilio-otp-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 20px 0;
    padding: 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #111827 !important;
    line-height: 1.6;
    background: #ffffff !important;
    border-radius: 16px;
    border: 1px solid #d6d6d6;
    animation: slideIn 0.5s ease-out;
}

/* Header */
.twilio-otp-wrapper h3 {
    margin: 0 0 40px 0;
    padding: 0 0 16px 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827 !important;
    border-bottom: 3px solid #dc2626;
    display: block;
    position: relative;
    background: transparent;
}

.twilio-otp-wrapper .description {
    margin: 0 0 32px 0;
    font-size: 15px;
    color: #374151 !important;
    line-height: 1.6;
}

.twilio-otp-wrapper p {
    color: #111827 !important;
}

/* Field Container */
.twilio-otp-field {
    margin-bottom: 24px;
    position: relative;
    animation: slideIn 0.3s ease-out backwards;
}

.twilio-otp-field:nth-child(1) { animation-delay: 0.05s; }
.twilio-otp-field:nth-child(2) { animation-delay: 0.1s; }
.twilio-otp-field:nth-child(3) { animation-delay: 0.15s; }

.twilio-otp-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #111827 !important;
    letter-spacing: 0.01em;
}

.twilio-otp-field label::after {
    content: " *";
    color: #dc2626;
    font-weight: 600;
}

/* Phone Input */
.twilio-otp-wrapper input[type="tel"],
.twilio-otp-wrapper .input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #111827 !important;
    background-color: #ffffff !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.twilio-otp-wrapper input[type="tel"]::placeholder,
.twilio-otp-wrapper .input::placeholder {
    color: #6b7280;
    font-size: 14px;
}

/* Action Buttons */
.twilio-otp-actions {
    margin-top: 16px;
}

.twilio-otp-wrapper .button,
.twilio-otp-wrapper .button-primary {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    color: #ffffff !important;
    padding: 14px 32px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    border: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: 100%;
    text-align: center;
    text-decoration: none !important;
}

.twilio-otp-wrapper .button:hover,
.twilio-otp-wrapper .button-primary:hover {
    background: linear-gradient(135deg, #b91c1c, #dc2626) !important;
    transform: translateY(-2px);
}

.twilio-otp-wrapper .button:active,
.twilio-otp-wrapper .button-primary:active {
    transform: translateY(0) !important;
}

.twilio-otp-wrapper .button:disabled {
    background: #94a3b8 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* OTP Entry Section */
#twilio-otp-enter {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid #f1f5f9;
    animation: fadeIn 0.4s ease-out;
}

#twilio-otp-enter p {
    font-size: 15px;
    color: #111827;
}

#twilio-otp-sent-to {
    color: #dc2626;
    font-weight: 600;
}

/* OTP Digit Inputs */
.twilio-otp-digits {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 0 auto 20px;
}

.twilio-otp-digit {
    width: 52px !important;
    height: 64px !important;
    padding: 8px 0 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    text-align: center !important;
    line-height: 1.5 !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    caret-color: #dc2626;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Verify and Resend Section */
.twilio-otp-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

#twilio-otp-verify {
    flex: 1;
    min-width: 200px;
}

/* Resend Link */
.button-link,
#twilio-otp-resend {
    background: none !important;
    color: #dc2626 !important;
    border: none !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.button-link:hover,
#twilio-otp-resend:hover {
    color: #b91c1c !important;
    background: rgba(220, 38, 38, 0.05) !important;
}

/* Message Display */
.twilio-otp-msg {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.twilio-otp-msg.notice-success {
    display: block;
    color: #10b981;
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.twilio-otp-msg.notice-error {
    display: block;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Loading Spinner */
.twilio-otp-wrapper .button:disabled::after {
    content: " ";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    .twilio-otp-wrapper { margin: 20px 0; padding: 24px; }
    .twilio-otp-wrapper h3 { font-size: 20px; margin-bottom: 32px; }
    .twilio-otp-digit { width: 46px !important; height: 58px !important; font-size: 20px !important; }
}

@media (max-width: 480px) {
    .twilio-otp-wrapper { padding: 20px; }
    .twilio-otp-wrapper h3 { font-size: 18px; margin-bottom: 28px; }
    .twilio-otp-digit { width: 40px !important; height: 52px !important; font-size: 18px !important; }
}

/* Focus States */
.twilio-otp-wrapper input:focus,
.twilio-otp-wrapper .twilio-otp-digit:focus {
    background-color: #fef2f2 !important;
    border-color: #dc2626 !important;
    outline: none;
}

/* Print */
@media print {
    .twilio-otp-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

.rm-verify-otp,
.rm-resend-otp {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.rm-verify-otp {
    background: #0073aa;
    color: white;
}

.rm-verify-otp:hover {
    background: #005a87;
}

.rm-resend-otp {
    background: #f0f0f0;
    color: #333;
}

.rm-resend-otp:hover {
    background: #e0e0e0;
}

.rm-otp-message {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    display: none;
}

.rm-otp-message.success {
    background: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
    display: block;
}

.rm-otp-message.error {
    background: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
    display: block;
}

/* OTP Wrapper */
.rm-otp-wrapper {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.rm-otp-sent-to {
    margin-bottom: 10px;
    font-size: 14px;
}

.rm-otp-digits {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.rm-otp-digit {
    width: 40px;
    height: 40px;
    text-align: center;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.rm-otp-actions {
    display: flex;
    gap: 10px;
}

.rm-otp-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}