/* Universal OTP Frontend Styles */
.universal-otp-wrapper {
    margin-top: 10px;
}

/* Step Tags (hidden or used for debug/admin view, but here for completeness if injected) */
.step-tag {
    background: #0073aa;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    vertical-align: middle;
}

/* Step 1: Input Group Style */
.otp-action-row {
    display: flex;
    gap: 0;
    /* Bootstrap input-group style often has 0 gap */
    width: 100%;
}

.otp-action-row button.btn-otp-send {
    background-color: #0d6efd;
    /* Bootstrap Primary */
    color: white;
    border: 1px solid #0d6efd;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0 0.25rem 0.25rem 0;
    cursor: pointer;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.otp-action-row button.btn-otp-send:hover {
    background-color: #0b5ed7;
}

.otp-action-row button.btn-otp-send:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: default;
}

/* Make phone input look joined if possible, but hard to force on dynamic form.
   We will just style our button nicely next to it or below it. */

/* Step 2: Verification */
.otp-verify-row {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    /* Bootstrap border-primary color in design was blue, here generic*/
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.otp-verify-label {
    font-weight: bold;
    color: #0d6efd;
    display: block;
    margin-bottom: 5px;
}

/* Old Input Style (Hidden/Unused in V2 but kept for fallback if needed) */
.otp-input-code-legacy {
    letter-spacing: 12px;
    font-size: 24px;
    text-align: center;
    font-weight: bold;
    width: 100%;
    max-width: 200px;
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    display: block;
    margin-bottom: 10px;
}

/* --- V2 Segmented OTP Styles --- */
.otp-digit-container {
    display: flex;
    gap: 8px;
    justify-content: flex-start; /* Changed from center to align with typical left-aligned form fields */
    margin-bottom: 10px;
}

.otp-digit-input {
    width: 45px;
    height: 50px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    padding: 0; /* Clear padding to ensure vertical centering */
}

.otp-digit-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
    outline: none;
}

.otp-digit-input.filled {
    border-color: #0d6efd;
    background-color: #f0f8ff; /* Light blue tint for filled */
}

.otp-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: .2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
    color: #0d6efd;
    margin-right: 5px;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Step 3: Success */
.otp-success-msg {
    text-align: center;
    padding: 15px;
    border: 1px solid #198754;
    /* Success green */
    border-radius: 8px;
    background: #f0fff4;
    margin-top: 15px;
}

.otp-success-icon {
    font-size: 2rem;
    color: #198754;
    line-height: 1;
    margin-bottom: 5px;
}

.otp-success-text {
    font-weight: bold;
    color: #198754;
    font-size: 1.1rem;
    margin: 0;
}

.otp-success-sub {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Disabled Submit Button */
.disabled-by-twilio-otp {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    /* Strong disable */
}