/**
 * DOTNET IT - Frontend Styles
 */

.dotnet-it-otp-section {
    background: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.dotnet-it-otp-section h3 {
    margin-top: 0;
    color: #007bff;
    font-size: 18px;
    margin-bottom: 15px;
}

.dotnet-it-otp-send-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.dotnet-it-otp-info {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.dotnet-it-timer {
    display: inline-block;
    padding: 8px 15px;
    background: #007bff;
    color: #fff;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
}

.dotnet-it-otp-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dotnet-it-otp-input-group input {
    flex: 1;
    max-width: 200px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 5px;
    font-weight: bold;
}

.dotnet-it-otp-input-group button {
    min-width: 100px;
}

.dotnet-it-otp-input-group button.verified {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.dotnet-it-message {
    display: block;
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-weight: bold;
}

.dotnet-it-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.dotnet-it-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ── Phone field with 880 prefix ─────────────────────────────────────────── */
.dotnet-phone-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s;
}

.dotnet-phone-wrapper:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

.dotnet-phone-wrapper.is-valid {
    border-color: #28a745;
}

.dotnet-phone-wrapper.is-invalid {
    border-color: #dc3545;
}

.dotnet-phone-prefix {
    background: #f0f0f0;
    color: #333;
    font-weight: 600;
    padding: 0 10px;
    font-size: 15px;
    border-right: 1px solid #ccc;
    line-height: 1;
    display: flex;
    align-items: center;
    align-self: stretch;
    user-select: none;
    white-space: nowrap;
}

.dotnet-phone-wrapper input#dotnet_phone_display {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    flex: 1;
    padding: 10px 12px !important;
    font-size: 15px;
    background: transparent;
    margin: 0 !important;
    min-width: 0;
}

.dotnet-phone-error {
    display: none;
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
}

/* ── OTP Modal ───────────────────────────────────────────────────────────── */
.dotnet-otp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dotnet-otp-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    margin: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
}

.dotnet-otp-modal-header {
    background: #007bff;
    padding: 18px 24px;
}

.dotnet-otp-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.dotnet-otp-modal-body {
    padding: 24px;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.dotnet-otp-hint {
    color: #555;
    font-size: 14px;
    margin: 0;
}

.dotnet-otp-step {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Spinner */
.dotnet-otp-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: dotnet-spin 0.7s linear infinite;
}

@keyframes dotnet-spin {
    to { transform: rotate(360deg); }
}

/* 6-box OTP input */
.dotnet-otp-boxes {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.dotnet-otp-overlay .dotnet-otp-box {
    width: 44px !important;
    height: 52px !important;
    min-height: unset !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    text-align: center !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #333 !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: border-color 0.2s;
    outline: none !important;
    display: block;
    flex-shrink: 0;
}

.dotnet-otp-overlay .dotnet-otp-box:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15) !important;
}

.dotnet-otp-error {
    color: #dc3545;
    font-size: 13px;
    margin: 0;
}

.dotnet-otp-resend {
    font-size: 13px;
    color: #888;
}

.dotnet-otp-resend button {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
    padding: 0;
}

/* Success */
.dotnet-otp-success-icon {
    width: 56px;
    height: 56px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dotnet-otp-modal-footer {
    padding: 12px 24px 20px;
    text-align: center;
}

.dotnet-otp-cancel {
    background: none;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 24px;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.dotnet-otp-cancel:hover {
    background: #f5f5f5;
}

/* ── Blocked Modal ───────────────────────────────────────────────────────── */
.dotnet-blocked-header {
    background: #dc3545;
}

.dotnet-blocked-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 4px;
}

.dotnet-blocked-ok-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.dotnet-blocked-ok-btn:hover {
    background: #c82333;
}

/* Responsive */
@media (max-width: 768px) {
    .dotnet-it-otp-send-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .dotnet-it-otp-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .dotnet-it-otp-input-group input,
    .dotnet-it-otp-input-group button {
        max-width: 100%;
        width: 100%;
    }
}
