/* OTP Verification UI */
.twilio-otp-wrapper {
    max-width: 500px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.twilio-otp-wrapper h3 {
    color: var(--text-primary);
    font-size: 24px;
    margin: 0 0 10px;
    font-weight: 700;
}

.twilio-otp-wrapper .description {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

.twilio-otp-field {
    margin: 20px 0;
    text-align: left;
}

.twilio-otp-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.twilio-otp-field input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.twilio-otp-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--input-focus-bg);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.twilio-otp-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
}

.twilio-otp-actions button {
    min-width: 140px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#twilio-otp-send {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-md);
}

#twilio-otp-send:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.rm-otp-back-btn {
    background: #f1f5f9 !important;
    color: var(--text-primary) !important;
}

.rm-otp-back-btn:hover {
    background: #e2e8f0 !important;
}

/* OTP Digit Input */
.twilio-otp-digits {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
}

.twilio-otp-digit {
    width: 45px !important;
    height: 54px;
    padding: 0 !important;
    font-size: 24px !important;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    transition: all 0.3s ease;
}

.twilio-otp-digit:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--input-focus-bg);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    transform: translateY(-2px);
}

/* OTP Controls */
.twilio-otp-controls {
    margin-top: 24px;
    text-align: center;
}

#twilio-otp-verify {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 12px 32px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

#twilio-otp-verify:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

#twilio-otp-resend {
    display: inline-block;
    margin-top: 16px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

#twilio-otp-resend:hover {
    text-decoration: underline;
}

/* Messages */
.twilio-otp-msg {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.twilio-otp-msg.notice-error {
    background-color: #fee2e2;
    color: #dc2626;
}

.twilio-otp-msg.notice-success {
    background-color: #dcfce7;
    color: #16a34a;
}

/* Loading States */
.twilio-otp-actions button.loading,
#twilio-otp-verify.loading {
    position: relative;
    color: transparent !important;
}

.twilio-otp-actions button.loading::after,
#twilio-otp-verify.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: otp-spinner .75s linear infinite;
}

@keyframes otp-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Card Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.twilio-otp-wrapper {
    animation: slideUp 0.4s ease-out;
}

/* CSS Variables */
:root {
    --primary-color: #dc2626;
    --primary-light: #ef4444;
    --primary-dark: #b91c1c;
    --text-primary: #111827;
    --text-secondary: #374151;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --input-focus-bg: #fef2f2;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Responsive Design */
@media (max-width: 480px) {
    .twilio-otp-wrapper {
        margin: 20px auto;
        padding: 20px;
    }

    .twilio-otp-digits {
        gap: 8px;
    }

    .twilio-otp-digit {
        width: 40px !important;
        height: 48px;
        font-size: 20px !important;
    }

    .twilio-otp-actions {
        flex-direction: column;
    }

    .twilio-otp-actions button {
        width: 100%;
    }
}